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

Calculate what week of the year it is

Status
Not open for further replies.

nickloe

IS-IT--Management
Feb 9, 2009
6
US
In one of my reports I need to base a calculation on what week it is of the year. For example, Feb 9 - 13 is the 6th full week of the year.

Does anyone know how to get this calculation?

Thanks!! Nick
 
Use Crystal function datepart

datepart("ww", {datefield})

This will return week number of year.

Ian
 
I think you would have to add the FirstDayofWeek and FirstWeekofYear arguments:

datepart("ww",currentdate,crSunday,crFirstFullWeek)

Note that to use FirstWeekofYear argument correctly, you have to also specify the FirstDayofWeek.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top