[thelist] Updating two fields with SQL

Howell, Katie Kathleen.Howell-1 at kmail.ksc.nasa.gov
Mon Aug 21 12:23:25 CDT 2000


Don't think you need the AND.  Try:
UPDATE Tablename
Set	firstfield='newvalue',
	secondfield='secondvalue'
where ID=#form.id#


-----Original Message-----
From: Minh Lee Goon [mailto:v7ac at sdsumus.sdstate.edu]
Sent: Monday, August 21, 2000 12:15 PM
To: evolt
Subject: [thelist] Updating two fields with SQL


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.

</ml>


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 





More information about the thelist mailing list