View Full Version : Date criteria


fathyano
06-01-2009, 12:43 AM
:mad:
I have a table containing a field in a formate of a date, and I want to create a query returns all records of a spesific month in any year, I have found exactly what I need in the access help, but it does not work!!!!

The code to be written in the criteria cell is- as mentioned in the HELP- is:

DatePart("m", [SalesDate]) = 12

It means to return all values took place in December of any year.

For now it is good, but the problem is that there is an error which I wounder about, the error says: "THE EXPRESSION YOU ENTERED CONTAINS INVALID SYNTAX
......., you entered an invalid characters or commas"

This is the error message, and when I press Esc I find the comma selected (flasher selection), as if it wants to say that it is wrong to write this comma.

NOTE:- The above-mentioend code is copy and past from the help!!!!!!!!

What is the reason of that, and however, what is the way for doing so?????

Thanks a lot

DCrake
06-01-2009, 12:56 AM
Add another column to your query

NoMonth : DatePart("m",[StartDate])

Then in the criteria section enter 12


David

MStef
06-01-2009, 12:58 AM
Try with ; instead of ,

fathyano
06-01-2009, 08:14 AM
Done, thank you very very very much.