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

calculating week number using a nominated start date 2

Status
Not open for further replies.

Lochbel

Technical User
Dec 5, 2002
125
AU
CRXI
Looking for a simple technique to calculate the week number of a date when the first week of year is to start at a non standard point e.g 28-June-2009.


e.g. 31-August-2009 = Week 10 (when Week 1 commences 28-June-2009)

TIA



Lochbel
Australia
 
Try:

if datepart("ww",{table.date})-datepart("ww", {?startdate}) < 0 then
datepart("ww",{table.date})+ 53 - datepart("ww", {?startdate})+1 else
datepart("ww",{table.date})-datepart("ww", {?startdate})+1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top