Update query question

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

can I do like this?

UPDATE mytable SET myfield = (SELECT uniquevalue FROM othertable WHERE
somecondtion) WHERE fieldid = givenvalue

In select statement there will be always one value.

Thanks.
 
I'm not sure if Access SQL supports an update using a subquery. I know that
you could use:

UPDATE mytable SET myfield = DLookup("uniquevalue", "Othertable",
"somecondition") WHERE fieldid = givenvalue
 
Thanks Duane, that will work.
Duane Hookom said:
I'm not sure if Access SQL supports an update using a subquery. I know that
you could use:

UPDATE mytable SET myfield = DLookup("uniquevalue", "Othertable",
"somecondition") WHERE fieldid = givenvalue
 
Back
Top