Thanks rudy, this is the solution. I don't know whether it has something to do with the server set up but this is what does the job:
[code]... where datefield < concat(yyyy,'-',mm,'-','01')[/cpde]
Thanks for the reply guys.
Actually my task is a bit trickier:
I need to select all the records prior to the selected month (and year), not including the month.
SELECT * FROM table WHERE YEAR(datefield)<2004 and MONTH(datefield)<3 would work for February 2004 but not December 2003 (as any other...
This is probably a very simple question, so I am hoping someone has an easy answer.
I have a table of records with a date field in M/D/Y format.
How do I select all the records for the month (and selected year)?
Thanks in advance
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.