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.