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

Why wont this DatePart Method work.

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Why doesn't this work?

SELECT DownloadFile, TransactionType, TransactionDate
FROM Transaction
WHERE (DatePart("yyyy", [TransactionDate]) = 1999) AND (DatePart("mm", [TransactionDate]) = 7)

This works:
SELECT DownloadFile, TransactionType, TransactionDate
FROM Transaction
WHERE (DatePart("yyyy", [TransactionDate]) = 1999)

I just don't get it...

Thanks
 
Is there any reason why you're using "mm" instead of "m" for the second DatePart?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
OK, i think i figured this out, the DatePart method requires month as "m" not "mm" in Access.
 
Thanks. Now I just have to figure out why this EXACT same query will not work in a ColdFusion query. Time, well Dates specifically in this case, are not on my side here...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top