Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Day of the week 2 Wednesdays ago 1

Status
Not open for further replies.

Dross

Programmer
Aug 16, 2001
212
US
You probably heard this a hundred times already or at least a variation of, but I need a formula to find the date 2 Wednesdays ago no matter what day of the week you are currently on. In other words today is the 28th, so I need a formula to give me the 19th. If it was the 26th, I would want 2 Wednesdays ago so that would be the 12th. Does anyone have a formula for this?
 
Try:

If dayofWeek(currentdate) =4 then
(currentdate) - 14
else
((currentdate) - (dayofWeek(currentdate) + 3))-7

-k
 
It looks like it works great. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top