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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top