Connecting Tech Pros Worldwide Forums | Help | Site Map

Get first day of week?

Targa
Guest
 
Posts: n/a
#1: Jul 19 '05
Need to print "Week of (first day of week)"
First day being Monday.

ie:
week = Request.querystring("mydate")
response.write "Week of" & week

If week = 5/6/2004 (which is Thursday) it should output "Week of Monday, May
03, 2004"

How can I do this?

Thanks!



Aaron Bertrand - MVP
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Get first day of week?


http://www.aspfaq.com/2489

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




"Targa" <targa1SPAMSUCKS@alltel.net> wrote in message
news:uAIIDM5MEHA.268@TK2MSFTNGP11.phx.gbl...[color=blue]
> Need to print "Week of (first day of week)"
> First day being Monday.
>
> ie:
> week = Request.querystring("mydate")
> response.write "Week of" & week
>
> If week = 5/6/2004 (which is Thursday) it should output "Week of Monday,[/color]
May[color=blue]
> 03, 2004"
>
> How can I do this?
>
> Thanks!
>
>[/color]


dlbjr
Guest
 
Posts: n/a
#3: Jul 19 '05

re: Get first day of week?


'From dlbjr

Function GetPriorMonday(dtmDate)
GetPriorMonday = "NAD"
If IsDate(dtmDate) Then
intAdjust = WeekDay(dtmDate,2) - 1
GetPriorMonday = DateAdd("d",- intAdjust,dtmDate)
End If
End Function


Closed Thread


Similar ASP / Active Server Pages bytes