G
Guest
I would like to create a query that will show me the amount of records per
week for the whole year. The week begins on a Thurday and ends on a
Wednesday. I have a function() for the week call LastThurs() and is as
follows:
Function LastThurs() As Date
'This will find last Thursday's date
Dim strDates As Date
Dim intDay As Integer
intDay = Weekday(Date) 'Finds today's day of the week
Select Case intDay
Case 1 'Sunday!
strDates = Date - 3
Case 2 'Monday
strDates = Date - 4
Case 3 'Tuesday
strDates = Date - 5
Case 4 'Wednesday
strDates = Date - 6
Case 5 'Thursday
strDates = Date
Case 6 'Friday
strDates = Date - 1
Case 7 'Saturday
strDates = Date - 2
End Select
LastThurs = strDates
End Function
week for the whole year. The week begins on a Thurday and ends on a
Wednesday. I have a function() for the week call LastThurs() and is as
follows:
Function LastThurs() As Date
'This will find last Thursday's date
Dim strDates As Date
Dim intDay As Integer
intDay = Weekday(Date) 'Finds today's day of the week
Select Case intDay
Case 1 'Sunday!
strDates = Date - 3
Case 2 'Monday
strDates = Date - 4
Case 3 'Tuesday
strDates = Date - 5
Case 4 'Wednesday
strDates = Date - 6
Case 5 'Thursday
strDates = Date
Case 6 'Friday
strDates = Date - 1
Case 7 'Saturday
strDates = Date - 2
End Select
LastThurs = strDates
End Function