Hello,
I have a SQL statement that gets information from the previous month. It is scheduled to run every first of the month. However, if necessary, the SQL will need to be re-run after the first of the month but still get the same information. Currently, I have a dateadd(month, -1, getdate()) and dateadd(day, -1, getdate()) declaration to set the first and last day of the previous month. What can I do to get the same information if the SQL is run after the first of the month? Thank you.
I have a SQL statement that gets information from the previous month. It is scheduled to run every first of the month. However, if necessary, the SQL will need to be re-run after the first of the month but still get the same information. Currently, I have a dateadd(month, -1, getdate()) and dateadd(day, -1, getdate()) declaration to set the first and last day of the previous month. What can I do to get the same information if the SQL is run after the first of the month? Thank you.