Link to home
Start Free TrialLog in
Avatar of bburden
bburden

asked on

Please Help with...How to subtract datefield from Date()

I have been trying to write a query to pull from a field called date_open - Date().  What I want to see is when the date_open is over 21 days due I want the query to show just those records.  The other criterial are they need to be open or pending only. The below script is what I have worked with for the past 2 days with no avail.  Can someone please just look at it and lead me in the right direction.  Thanks in advance for all your help.

The error is listed also below.

SELECT ticket_Table1.date_open, ticket_Table1.tkt_id, ticket_Table1.service_tkt_status

FROM ticket_Table1

WHERE ((date_open<[# & Date()-21 & #])) AND ((ticket_Table1.service_tkt_status)='Open' Or (ticket_Table1.service_tkt_status)='Pending Approval')
ORDER BY ticket_Table1.tkt_id DESC;

I looked this error up and I made sure all the fields are spelled the same:

Database Results Error
Description: No value given for one or more required parameters.
Number: -2147217904 (0x80040E10)
Source: Microsoft JET Database Engine
ASKER CERTIFIED SOLUTION
Avatar of CWS (haripriya)
CWS (haripriya)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial