I am writing a DB2 query that will be run bi-monthly - once on the 16th of the month and once on the 1st of the following month:
- When the report runs on the 16th of the month, it should pull all data from the 1st to the 15th of that same month.
- When the report runs on the 1st of the following month, it should pull all data from the 16th of the previous month to the last day of the previous month.
I've found examples giving hints on how to accomplish this in T-SQL, but not necessarily in DB2. I know a lot of T-SQL date functions don't translate well. Can anyone assist with this piece of code? Thanks.