I have a small access database with some tables. I am trying the code in the sql design within access. I just want to randomly select a record within a table.
I created a simple table called StateAbbreviation
. It has two columns: ID
and Abbreviation
. ID
is just an autonumber and Abbreviation
are different abbreviations for states.
I saw this thread here. So I tried
SELECT Abbreviation
FROM STATEABBREVIATION
ORDER BY RAND()
LIMIT 1;
I get the error Syntax error (missing operator) in query expresion RAND() LIMIT 1
. So I tired RANDOM()
instead of RAND()
. Same error.
None of the others worked either. What am I doing wrong? Thanks.