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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Week Count Formula

Status
Not open for further replies.

hgraybill

MIS
Mar 30, 2007
32
US
I need to create a formula that will count the week numbers from the current date, but I'm stumped.

I've tried the datepart() formula, but haven't come up with anything.

Here's an example of what I'm after. If I was to run the report today, I would need each week numbered. For example this week would be week 1, next week would be week 2, etc.

Any help is greatly appreciated.
 
If today were selected (Tuesday), would the week be Sunday, February 1 to Saturday, February 7? If so, you could use:

//{@Week#}:
if datepart("ww",{table.date}) = datepart("ww",currentdate) then
"Week1" else
if datepart("ww",{table.date}) = datepart("ww",currentdate)+1 then
"Week2" else
if datepart("ww",{table.date}) = datepart("ww",currentdate)+2 then
"Week3" else//etc.

-LB
 
Yes, that's exactly what I needed.

Thank you for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top