Date query

J

Juan Gallego

Could someone help me with a query to report a result of
searching which codes in a table exists in the last three
months.
I have columns in my table of Code and Date. Codes can be
several times but in different dates. I am trying
to calculate them using the function: DateAdd("m", -3,
![Date]) but it says there is a sintaxis Problem.

Thanks
Juan Gallego
 
K

Ken Snell [MVP]

SELECT Code, [Date]
FROM MyTable
WHERE [Date] >= DateAdd("m", -3, Date());

Also, do not use Date as the name of a field. It and many other words are
reserved words in ACCESS, and can create serious confusion for ACCESS and
Jet. See these Knowledge Base articles for more information:

List of reserved words in Access 2002 and Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

List of Microsoft Jet 4.0 reserved words
http://support.microsoft.com/?id=321266

Special characters that you must avoid when you work with Access
databases
http://support.microsoft.com/?id=826763
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top