Solved

Access/Excel VBA - is a date on a weekend

Posted on 2011-03-16
4
647 Views
Last Modified: 2012-05-11
Hi

In Access or Excel VBA what code would I use to fdetermine if a date lies on a weekend.
Thanks
0
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 250 total points
ID: 35145870
If Weekday(Yourdate) = 1 or weekday(yourdate) = 7 then
    'You have a weekdend day

End if
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 35145871
This is for Access
0
 
LVL 50

Assisted Solution

by:Gustav Brock
Gustav Brock earned 250 total points
ID: 35145991
It can be done with one call only of Weekday:

booDateIsWeekend = Weekday(datSomeDate, vbMonday) >= 6

/gustav
0
 

Author Closing Comment

by:murbro
ID: 35146201
thank you both
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question