Update Queries

  • Thread starter Thread starter Rob Sykes
  • Start date Start date
R

Rob Sykes

Hey all, how would I run an update query using the results
of a select query?

Thanks in advance.
 
That's a pretty open-ended question. What are you trying to do

The generic form would be something like this -

UPDATE [YourTable} SET [SomeColumn]='Something' WHERE [PrimaryKey] IN(SELECT [PrimaryKey] FROM [YourTable] WHERE [SomeOtherColumn]='Your criterion')
 
I Have a Members table, with a expiry date field (expdate)
and field to track whether a renewal notice has been sent,
this is a yes or no data field (reminded). I've made a
query that lists members by a user entered date range that
excludes members that have been reminded (reminded field
is yes).

What I want to do is take the results from this first
query (the list of people that need a reminder letter sent
to them) and update the members table reminded field to
yes.

Hope that help you out a little bit.
-----Original Message-----
That's a pretty open-ended question. What are you trying to do?

The generic form would be something like this -

UPDATE [YourTable} SET [SomeColumn]='Something' WHERE
[PrimaryKey] IN(SELECT [PrimaryKey] FROM [YourTable] WHERE
[SomeOtherColumn]='Your criterion')
 
Back
Top