DB2 offers a wealth of functionality in terms of its date/time arithmetic support and date/time functions. I suggest...
you take a look at the "DB2 SQL Reference" manual available for download from IBM's Web site to read up on DB2's date/time support. To answer your specific question, though, the following query/predicate should return the rows where the posted date is greater than 7 days from the expiry date:
SELECT COL1, COL2, ... FROM YOUR_TABLE WHERE (POSTED_DATE + 7 DAYS) > EXPIRY_DATE;
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.