|
-
December 20th, 1999, 09:25 AM
#1
looping in dates
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
-
December 20th, 1999, 09:39 AM
#2
Re: looping in dates
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|