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

Query with date range criteria... PLEASE HELP!

Status
Not open for further replies.

tlcable7

Programmer
Aug 18, 2003
7
US
I am new to Access, and having some problems when querying date ranges from a database.

Here is my query:
SELECT Count(INPUTDATE) AS C_LastMonth
FROM QMortgage_ameriquest WHERE INPUTDATE >= '9/1/2003'


Here is the error I get:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.


That Query works fine on an MS SQL Database, why does it not work in Access, and what will work?

Travis Cable
travis@bridgewebdesign.com
 
Is InputDate a string or a date? If it's a date try this:

SELECT Count(INPUTDATE) AS C_LastMonth
FROM QMortgage_ameriquest WHERE INPUTDATE >= #9/1/2003#

Hope that helps.

Kevin
 

Try
SELECT Count(INPUTDATE) AS C_LastMonth
FROM QMortgage_ameriquest
WHERE INPUTDATE >= CDATE('9/1/2003')

 
Thanks,

This one worked perfectly...

SELECT Count(INPUTDATE) AS C_LastMonth
FROM QMortgage_ameriquest WHERE INPUTDATE >= #9/1/2003#

Travis Cable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top