Update query help

  • Thread starter Thread starter myxmaster
  • Start date Start date
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
 
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]));
 
Back
Top