Update query help

M

myxmaster

Thanks to Jon I have almost solved my problem.
When I run the following cade a box pops up that
says"yourtable.Datefield" to which I have to enter a date. I would
like the code to run autonatically when the database is opened based
on the current system time.I would also like to change waiting to
pending

UPDATE yourtable SET yourtable.Status = "Cleared"
WHERE (((yourtable.datefield)<Date()-10) AND
((yourtable.Status)="Waiting"));


This should run and update the status of any records that have a date
over
10 days old and a status of waiting.


TIA
 
A

Arvin Meyer [MVP]

yourtable.datefield is a placeholder for the actual name of the date field
in your actual table. If you want to choose whether the criteria is waiting
or pending try:

UPDATE yourtable SET yourtable.Status = "Cleared"
WHERE (((yourtable.datefield)<Date()-10) AND
((yourtable.Status)=[Please enter Waiting or Pending]));
 

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

Top