How to check for if a date is on a weekend!?

# Thread: How to check for if a date is on a weekend!?

1. dep
Senior Member
Join Date
Dec 1969
Posts
709

## How to check for if a date is on a weekend!?

People are entering information for days of the week.. what is the easiest way to check to see if they entered something for a Saturday or Sunday? <BR><BR>Any ideas are appreciated.<BR><BR>dep<BR>

2. Senior Member
Join Date
Dec 1969
Posts
2,930

## Weekday function

returns 0 to 6 or 1 to 7, i forget... but the highest and lowest numbers are saturday and sunday.

3. Senior Member
Join Date
Dec 1969
Posts
11,334

## RE: How to check for if a date is on a weekend!?

if weekday(yourDate) = 0 Then<BR>&#039;or use vbSunday instead of 0<BR><BR>Check out the weekday and weekdayname functions... they&#039;ll give you the exact things returned.

4. Senior Member
Join Date
Dec 1969
Posts
2,809

## 1 to 7 I think...<EOP>

.

5. Senior Member
Join Date
Dec 1969
Posts
506

## RE: How to check for if a date is on a weekend!?

Try the Weekday function<BR><BR><BR>dow = Weekday(dt)<BR><BR>will return 1 - 7. Sunday - Saturday unless you specify otherwise.

6. Senior Member
Join Date
Dec 1969
Posts
11,334

## ****

1 instead of 0<BR><BR>No matter... vbSunday would&#039;ve sufficed.<BR><BR>Why can&#039;t VBS behave with every other programming language and start at 0????

7. Senior Member
Join Date
Dec 1969
Posts
2,930

## i know

and sometimes it does, and sometimes it doesn&#039;t, like in arrays and strings... blech

8. Senior Member
Join Date
Dec 1969
Posts
506

## RE: ****

This is one of my major compaints about VB in general. Some things are 0 based, while other are 1.

9. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## That's the annoying part.

Some things DO start at 0. Others don&#039;t.<BR><BR>Bah! We should all go back to BASIC.

10. dep
Senior Member
Join Date
Dec 1969
Posts
709

## you're all awesome... thank you! <nt

.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•