Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to find total for all unpaid orders

Status
Not open for further replies.

SequelChik

Programmer
Joined
Apr 18, 2003
Messages
7
Location
GB
I can't get this right, I need to find an update query that will update the status of all unpaid orders of over 1 month to 'red'.
I've tried
UPDATE Customer
SET Customer.Status="Red"
WHERE Paid="No"
AND OrderDate=Now()>30

but it doesnt work. Can anyone help me?
Thanx x
 
WHERE (Paid=&quot;No&quot;) AND (OrderDate <= Now()- 30)

or

WHERE (Paid=&quot;No&quot;) AND (OrderDate <= Date()- 30)

or

WHERE Paid=&quot;No&quot; AND DateDiff(&quot;d&quot;, OrderDate, Date())>= 30

Good luck



[pipe]
Daniel Vlas
Systems Consultant

 
Thanks for your help, I'll give them a try, although I think I might be going wrong at the beginning of the statement

SequelChik x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top