[thelist] Updating two fields with SQL

Anthony Baratta Anthony at Baratta.com
Mon Aug 21 12:58:27 CDT 2000


At 09:15 AM 8/21/2000, you wrote:
>Dear evolta,
>I don't know if this is syntatically legal, but it should be logically
>correct. I'd like to update two fields of a row in one SQL statement.
>I've been using the following (without much success):
>    UPDATE TableName
>    SET    FirstField='New Value 1'
>    AND    SecondField='New Value 2'
>    WHERE  ID='#form.ID#'
>
>It hasn't worked both with and without the single quote marks for the
>ID, which is an autonumber in Access. Any thoughts? Thanks in advance.

Change the AND to a comma

>UPDATE TableName
>    SET    FirstField='New Value 1', SecondField='New Value 2'
>    WHERE  ID='#form.ID#'


----
Anthony Baratta
President
Keyboard Jockeys






More information about the thelist mailing list