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

Query using Date()

Status
Not open for further replies.

Hfnet

IS-IT--Management
Dec 31, 2003
369
GB
I am upsizing an mdb and I need to convert some queries>

I am querying using the following code:

SELECT DISTINCT itemsmain.tekref
FROM itemsmain
WHERE (((itemsmain.tekref) In (SELECT tekref FROM itemsmain WHERE datein Between Date()-90 And Date() GROUP BY tekref HAVING Count(*)>2)) AND ((itemsmain.datein) Between Date()-990 And Date()))
ORDER BY itemsmain.tekref;

And it is failing in the adp on the Date() bits saying 'Date' is not a recognized function name.

Can someone point me to the correct coding please? :)
 
If this is SQL Server Transact SQL then the current date function is getdate()
 
Not too sure. This is a stored procedure linking to SQL server 2003

I'll try the getdate and see how I go, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top