473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Get first day of week?

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!
Jul 19 '05 #1
2 4810
http://www.aspfaq.com/2489

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


"Targa" <ta*************@alltel.net> wrote in message
news:uA*************@TK2MSFTNGP11.phx.gbl...
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!

Jul 19 '05 #2
'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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Hardy Wang | last post by:
Hi: Are there any algorithms I can use, that based on a given date and a culture code (different cultures may have different beginning of week), I can get first and last date of the current week?...
4
by: Morten Wennevik | last post by:
In an earlier thread I said first day of week was defined as monday, not sunday and forgot all about the thread, so I never got to reply on where it says that. So here it is. ISO 8601 -...
1
by: Martin Emanuelsson | last post by:
Hello, Knowing year and weeknumber of this year, I'm looking for some way to get the date of the first and last day of that particular week. Does anyone have an idea about how to do this? ...
2
by: Benz | last post by:
Hello all, Can anyone please tell me how to find the first and last date of a week when the year and the week number is given? The week model followed is the ISO model: Monday is the 1st day of...
0
by: Lee Harr | last post by:
I wrote a function to return the first date of a given week (and a few related functions) : -- return the first date in the given week CREATE or REPLACE FUNCTION week_start(integer, integer)...
4
by: sweetpotatop | last post by:
Hi, I wonder if there is any function in VB or SQL that will return the date of first Monday of the Monday. Besides, is there are a way finding the numbers of Monday in a month? Thanks in...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
HI I have a stored procedure that returns data with a date field in the form of a DateTime type. I need to place data in variables based on days of the week starting with the first thursday of the...
4
by: Charlotte | last post by:
Hi, is it possible to determine the first and the last day of a week (with classic ASP) nu = "06/01/2008" week = (DatePart("ww",nu)) firstday = dateadd("d",(-datepart("w",date())),nu)...
5
by: chris10121 | last post by:
How can I get the first day of the week in php? I probably have to write a function, but i am not good with dates. I'm looking for a function where you input the week number and the year, and it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.