how to get the week no in a year given the date

pragash
10-08-2001, 09:04 PM
i would like to know , what functions that need to be used in order to get the week no in a year given the date..

i tried using the week(date) function but it does not seem to work..is there any other way i can solve this problem..tahnk you..

regards pragash..

orufet
10-08-2001, 09:10 PM
Well, if you have the date, you can find out what day of the year it is by using the DateDiff() function. Once you have the day of the year, you can divide by 7 to get the number of weeks that have passed...

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

Aspen2K
10-09-2001, 08:41 AM
If you have not fond it yet, try using Format$(Date$, "ww") and use it with a text box or label.

EG:

Label1.Caption = Format$(Date$, "ww")

-Or-

text1.Caption = Format$(Date$, "ww")

Laurent
10-09-2001, 08:47 AM
this can give you an approximative value only since the 1st january isn't always on a sunday.

1-check the weekday of the 01-01-01
2-use a select case statement to know how much days there was in the first week
3-substract the those days to your total
4-then /7 to get the number of weeks

does this sound good?

I'll be amongst the best any minute now !

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum