Determine if date is Saturday or Sunday

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone point me to code for determining if the date chosen by the user is
a Saturday or Sunday (or any other for that matter).

Thanks in advance.
 
If you want the literal day:
=Format(Weekday(Date),"dddd")
If you want a day number:
=Weekday(Date)
Sunday = 1, Mondday = 2, etc
 
Hi Paul

In addition, the Weekday function allows you to specify the first day of the
week, so:
If Weekday(Somedate, vbMonday) > 5 Then ...
will test for a Saturday or Sunday.

If you are using this function in a query then it won't understand the
constant vbMonday, so use the value 2 instead.
 
Back
Top