erika wrote:
I am trying to run the following update query in code.
UPDATE TableTest SET STATUS = "A" WHERE (Code <> "X") AND (Code <>
"J") ORDER BY DOB;
I am getting an error, "Missing Semicolon (;) at end of SQL statement".
Please tell me what is wrong with the syntax. It worked in Access 97.
But in Access 2003, it is so fussy!
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You don't need an ORDER BY clause in an UPDATE statement. Otherwise,
nothing else appears wrong w/ it.
What do you mean you're trying to run it in code? Do you mean in VBA?
Have you set it up like this:
Dim strSQL As String
strSQL = "UPDATE TableTest SET Status = 'A'" & _
"WHERE Code Not In ('X', 'J');"
Note the use of single quotes inside the strSQL. Double quotes delimit
the string; therefore, we must use single quotes inside double quotes.
I changed the criteria to use a more intuitive construct. Read the JET
SQL Reference (Access Help) for more info on the IN predicate.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQmaWX4echKqOuFEgEQI6qACglhtCE6ceGz5xtXf8cg4NJa K7XGMAn3+u
XHW6NUAmullw6UEeHCKYxTSH
=+39E
-----END PGP SIGNATURE-----