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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL's DATEDIFF through Access 1

Status
Not open for further replies.

Mugs321

Programmer
Jan 31, 2007
49
CA
Hi all,
I didn't know if this question should be written in this forum or the SQL one. I decided on this one since the error is being thrown from Access.

I am trying to add DATEDIFF to one of my queries as such:
Code:
"DATEDIFF(Week, '" & Date & "', prod_User.ExemptionDate)<=3"

When I run the query I get the following error:
"...query parameter produced this error: The object doesn't contain the automation object 'Week'"

The above DATEDIFF code works perfectly fine when typed directly into SQL server... any ideas?
 
What about this ?
"DateDiff('ww', Date(), prod_User.ExemptionDate)<=3"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Perfect!

I'd tried the abbreviations but didn't include the quotes!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top