Solved

Access/Excel VBA - is a date on a weekend

Posted on 2011-03-16
4
631 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
Comment Utility
If Weekday(Yourdate) = 1 or weekday(yourdate) = 7 then
    'You have a weekdend day

End if
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
Comment Utility
This is for Access
0
 
LVL 49

Assisted Solution

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

booDateIsWeekend = Weekday(datSomeDate, vbMonday) >= 6

/gustav
0
 

Author Closing Comment

by:murbro
Comment Utility
thank you both
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views 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 Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now