Need to create a monthly report and need help with how to get dates or # of days in a month
I need to run a sql query either the first day of the month and look at the previous month or run the last day of the month and look for all days in the current month.
How would I code this?
This is what we are doing now.
WHERE (Incident.CreatedDateTime >= GETDATE() - 30)
we determine the number of days in the month and run it on the first day of the month manually.
We would like to automate this.