Hi!
I have a startdate and stopdate in datetype and I want to "loop" through it and select specific weekdays - say for example all sundays.
Does anyone know how to do that?
Thanks
Jen
Printable View
Hi!
I have a startdate and stopdate in datetype and I want to "loop" through it and select specific weekdays - say for example all sundays.
Does anyone know how to do that?
Thanks
Jen
Here's an example using the VB 'WeekDay' command :
Dim dteOne as date
Dim dteTwo as date
Dim lCount as Long
dteOne = #12/25/1999#
dteTwo = #1/1/2000#
for lCount = dteOne to dteTwo
If Weekday(lCount) = vbSunday then
Debug.print CDate(lCount); " = Sunday"
End If
next
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb