Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access/Excel VBA - is a date on a weekend

Posted on 2011-03-16
4
Medium Priority
?
660 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:Murray Brown
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 1000 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 52

Assisted Solution

by:Gustav Brock
Gustav Brock earned 1000 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:Murray Brown
ID: 35146201
thank you both
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

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