Discussion Locked

MS Access 97 Day of the Week

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am entering a date in the format 04/27/2001. I want the program to determine which day of the week (Friday)corresponds to that date. I could not find an Access function to do this.

Thanks,
Alan
NYC

3 replies

by kevin.riggs

Weekday() function returns an integer value where Sunday is 1 and Saturday is 7. Here is some VBA code that should work for you:

'******************
' Code Snippet
'******************

Dim iDay As Integer
Dim sDay As String
iDay = Weekday(Date)

Select Case iDay
Case 1
sDay = "Sunday"
Case 2
sDay = "Monday"
Case 3
sDay = "Tuesday"
Case 4
sDay = "Wednesday"
Case 5
sDay = "Thursday"
Case 6
sDay = "Friday"
Case 7
sDay = "Saturday"
End Select

'******************
' End Snippet
'******************

This discussion is closed to new replies.