How to Get the Date(Moday - Sunday) Info
Hi, :wave:
Code:
Any solution given if i would like to get next week "moday- sunday".
For Example :
Today is 08/08/2008 - wednesday
Next Week 24/08/2008 - Moday
----------------------------------------------------
Mon(24/08/2008)| Tue(25/08/2008)| Wed(26/08/2008)|
-----------------------------------------------------
thanks for any reply.
VbForum ... is the best for vb...
Re: How to Get the Date(Moday - Sunday) Info
Is this what you want?
Code:
Sub DayWeekName()
'This will give you Wednesday
MsgBox Format(#8/20/2008#, "dddd")
End Sub
Re: How to Get the Date(Moday - Sunday) Info
If this is an exercise then I'll give narrative requirements spec so there's effort on your part and you learn.
If your no longer a student or already a professional, then I'll still give you narrative requirement as you should already know how to read such by now.
If you add 7 then you will get same day next week... so you need to subtract x number of days to reset date to target start date (monday)... to know how many days to subtract you need to get ordinal position (1-7) of given date... you can use WeekDay() function for this with start of week specified... simple arithmetic would then yield date of target start date (monday)... you would then just loop 7 times to get the dates from target start date (monday) to sunday.
Re: How to Get the Date(Moday - Sunday) Info
A good lecturer, leinad. :thumb:
I intended to give him the code but let him try first.