ACCESS EXPERTS

FOR HELP WITH YOUR ACCESS DATABASES, INCLUDING SQL SERVER, WE ARE JUST ONE CLICK AWAY...


Tuesday, July 13, 2010

Access function to return day of the week

Sometimes you need the actual day name of the date and not the numeric equivalent, the following function will do that for you:

Private Function MyWeekDayName(dteDate As Date) As String

'Will return "Monday", "Tuesday", etc. based on the date supplied

MyWeekDayName = WeekdayName(WeekDay(dteDate), False)

End Function

Example use in debugger window:

?MyWeekDayName(#10/19/2009#)

Monday

No comments:

Post a Comment