DB2 date function for Thurs, Fri, Sat of every week

I'm creating a dynamic report. I need a date function for items that may expire on Thurs or Fri or Sat of every week that the report is run.
How do would I write such a date function?

Thank you.
saved4useAsked:
Who is Participating?
 
Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:
Hi Saved,

That's somewhat ambiguous, but with just a bit more information the query is easy to write.

SELECT *
FROM {mytable}
WHERE dayofweek (expiration_date > 4)               -- select only thurday, friday, saturday
  AND current_date + 6 days <= expiration_date   -- and within the next 7 days
  AND expiration_date >= current_date                  -- and in the future (or today)

That's a pretty good start.  It's easy to adjust as you need it.


Good Luck,
Kent
0
 
momi_sabagCommented:
what exactly do you want the function to do? it is not clear from your description
0
 
saved4useAuthor Commented:
Reflect items that expire on Thurs, or Fri or Sat of every week. *I need a DB2 date function, for example, 'CURRENT _DATE + 3 days'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.