Solved

Access/Excel VBA - is a date on a weekend

Posted on 2011-03-16
4
640 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
  • 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 49

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

821 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