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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing my own DatePart() function

Status
Not open for further replies.

neillovell

Programmer
Aug 27, 2002
560
0
0
GB
Hi,
I want to get the week number of the date entered. In Access I can use
DatePart("ww", DateEntered)
to return the week number (say 43 or whatever).

However I'm coding a set of active server pages for my front end and I must find the week number for any given date. Does anyone know how to get this without having a HUGE number of select case statements with each day of the year?

 
Are you using VBScript or JavaScript, or another.
If you are using VBScript you can simply use the DatePart Function it will work in VBScript as well.

DatePart('ww', DateEntered)
The hardest questions always have the easiest answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top