I would like to create a SQL statement to later be used in my code, that gets the date range for the current month.
Example: This is August, so the date range would be
StartDate = 08/01/11
EndDate = 08/31/11
however, if it was February
StartDate = 02/01/11
EndDate = 02/28/11
Select *
from mytable
where (check_date >= StartDate) AND (check_date <= EndDate)
thanks for any help you may be able to give
The you can find the start of this month with the months-since-zero trick. The last day of the month is one month later, minus one day:
This prints: