Week Number

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
 
D

Douglas J. Steele

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.
 
R

Ruskin Hardie

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!!!!
 
V

Van T. Dinh

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top