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

Date Question - Visual Basic 6.0

Status
Not open for further replies.

Danielvb

Programmer
Oct 8, 2002
34
US
Please I need help.

-- I am writing a process in which SUNDAY is the first day of the week

-- I need to dectect the beginning of the last week. For example:

a) 11/25/2002 (SUN) - 11/30/2002 (SAT). This is my last week

b) 12/02/2002 is the current date

I need to detect the firts day of the last week and add the date (mm/dd/yy) into an array. I am need to add only the Seven days.


Can somebody help me how to acompllish this task.

Thanks to all for your time

 
Dim temp As Date
temp = Date - 7
Do Until Weekday(temp, vbSunday) = 1
temp = temp - 1
Loop
MsgBox "Beginning of Last week is: " & temp
MsgBox "End of Last week is: " & temp + 6
 
Thanks alot DrJavaJoe

Your tips have been so helpful to me.

Take care

Daniel
Hollywood,FL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top