Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weeknum Function in Access

Status
Not open for further replies.

KMdouglas

MIS
Jan 17, 2000
11
US
I need to find a way to automatically caluclate what week of the year a date is contained in. Excel allows a WEEKNUM function to do this, and according to Access Help, access should too. However, when I try to the use this function I get a &quot;Undefined Function&quot; message. Could someone please help me out.<br>
<br>
Thanks,<br>
<br>
Kevin
 
Yes it does but its different<br>
x = Format(Now, &quot;ww&quot;)<br>
where x will be the number 4 for this week<br>
<br>
Look at these others too.<br>
CDate<br>
DateSerial
 
Make your own function<br>
<br>
Public Function WeekNum(Mydate)<br>
WeekNum = Format(Now, &quot;ww&quot;)<br>
End Function<br>

 
Sorry the above function should read<br>
<br>
Public Function WeekNum(Mydate)<br>
WeekNum = Format(Mydate, &quot;ww&quot;)<br>
End Function<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top