Week Number

  • Thread starter Thread starter Ramone
  • Start date Start date
R

Ramone

Hello All,

I'm trying to build an expression that needs to use the
week number. Does Access have a function that will give me
a the week number for a particular date?


Thanks for any help,

Ramone
 
Or, if you'd rather have a numeric value (Format returns a string), you can
use DatePart("ww", Now).

You should check the help file: there are a couple of optional parameters
that you can use to control how it calculates when the first week starts.
 
Format only returns a string, depending on the format code returned... If it
returned a string then;

Dim x As Long
x = Format(Now, "ww")

would give err = 13 (type mismatch). IT DOES NOT!!!!
 
Access does the automatic type-casting from String to Long
for you. Therefore, you don't get the type mismatch error.

HTH
Van T. Dinh
MVP (Access)
 
Back
Top