I am trying to figure out how to write the 'where' part of a query. Basically we have a table with a record every day, and the column of type DATETIME.
The 'where' part of the query I want is:
All records from 3 months ago (starting on the first day of the month) ending at the last day of the previous month.
So example, assuming today: October 5th.
I want: WHERE datetime BETWEEN '07/01/2010' AND '09/30/2010'
Another example, assuming today is November 30th:
I want: WHERE datetime BETWEEN '08/01/2010' AND '10/31/2010'
View Complete Post