troubleshooting Question

DB2: Help creating a query that must run bi-monthly.

Avatar of PresidentLincoln
PresidentLincolnFlag for United States of America asked on
DatabasesSQLDB2
13 Comments1 Solution191 ViewsLast Modified:
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.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros