Weekending Dates

Arvin

I'm liv'in the dream ....
Local time
Today, 15:11
Joined
Jul 22, 2008
Messages
192
Is it possible to get a list of all weekending dates between 2 dates in a query? for example,

1/1/2012 and 12/31/2012

if so, how ?

I've been able to get the weekending date based on 1 date but between 2 dates

thank you in advance
 
How do you define week ending date? Friday, Saturday, Sunday???

Look up the first "weekending date" in the new year, and make a list of this date + 7 days.
DateAdd()

Some code:
Code:
Sub AllFridaysIn2012()
Dim i As Integer
Dim st As Date
Dim ed As Date
st = #1/6/2012#  'First Friday
ed = #12/31/2012#
For i = 1 To 53
    st = DateAdd("d", 7, st)
    If Year(st) > Year(ed) Then Exit For
    Debug.Print WeekdayName(Weekday(st)) & "  " & st
Next i

End Sub
 
Last edited:
Thank you ! ...this works great ... and the weekending is Sunday
 

Users who are viewing this thread

Back
Top Bottom