View Full Version : updating a field after a month


wannabepro
04-13-2005, 06:42 AM
UPDATE Tblfin SET Tblfin.Processes = "Active"
WHERE (((Tblfin.Processes)="New") AND ((Tblfin.DateRecieved)<=30));


I need help in this query, what I am trying to do is I want to update a combo box where new records should be updated automatically and become active after a month. I know I am making a mistake, but I don't know where exactly. Because, its only working when date is less than 30 days, but for some strange reason its not doing this for more than value. What should I do?
Thanks in adv.

Brianwarnock
04-13-2005, 07:04 AM
You will need to use Datediff

Datediff("d",Date(),Tblfin.DateRecieved)<=30

wannabepro
04-13-2005, 07:26 AM
You will need to use Datediff

Datediff("d",Date(),Tblfin.DateRecieved)<=30

Thanx, but its still giving me all the new records, where it should only show me one, cuz only of the record is over 30 days old, all other ones are not yet close to even 30 yet.

Brianwarnock
04-13-2005, 07:30 AM
should be >= or just >30

Brian

wannabepro
04-13-2005, 08:01 AM
should be >= or just >30

Brian


it should be those records which are reaching 30 days or over 30 days.

so should be >=30

Pat Hartman
04-13-2005, 12:49 PM
You are comparing a date to 30 rather than the difference in days.

UPDATE Tblfin SET Tblfin.Processes = "Active"
WHERE (((Tblfin.Processes)="New") AND ((Tblfin.DateRecieved)<= Date() - 30));