Hi,
No problem.
I'll use July 2004, August 2004 is just too ... simple (for a North American
calendar, first of August 2004 is a Sunday, so no "partial" week starting
the month, not typical, so, too simple). So, with July 2004.
If I want, about the 12th, get 2, since it is the second Monday of the
month,
1+ (Day(#7-12-2004#) -1) \ 7
or,
1+ (Day( x ) - 1) \ 7
If you want 3, because it is in the third line of the calendar:
1+ DateDiff("ww", #7-1-2004#, #7-12-2004#, vbSunday)
where the first date is the first of the month, and the second date is the
one we are inquiring.
( The first of the month can be obtain with: DateSerial( Year( x ),
Month( x ), 1 ), given a date, x.
Sure, if you just want to know if it is a Monday or a Friday:
DatePart("w", #7-1-2004#)
or
Weekday( #7-1-2004#)
Note that DatePart("ww", ... ) supplies the week number (of the year), but
don't make statistics based on it, since the last week of the year, 53, is
generally not a full week, and would have be to be merged with week=1 of the
year after (we know that stats are sensible to extremes, so having 2
"incomplete" sets (weeks 1 and 53) over 53 sets may lead to seriously wrong
"mean", "median", etc. )
Hoping it may help,
Vanderghast, Access MVP