Obtain the week of the yearTag(s): Powerscript

// a week # (1-53) 
Date ld_today, ld_januaryFirst
int  li_year
long ll_weekOfTheYear
dt_today = Today()
li_year = Year(ld_today)
ld_januaryFirst = Date( String( li_year ) + '-01-01' )
ll_weekOfTheYear = Int( ( DaysAfter(ld_januaryFirst, Date(ld_date)) + &
        DayNumber(ld_januaryFirst) ) / 7) + 1



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]