Weekend date

J

Johanna Gronlund

Hello,

I need to filter my query for weekend dates only. Is there an easy way of
doing this?

I was going to do a table on excel with all the dates for the time period
with column determining if they are week or weekend date. However, this is
very time consuming and it would be good to know if there is a formula. I am
not very experienced with formulas in Access so it will need to be spelled
out.

Many thanks in advance,

Johanna
 
N

NuBie via AccessMonster.com

take a look at this:

this query will select records from your table with dates that fall on
Saturday or Sunday.

SELECT YourTable.DateField
FROM YourTable
WHERE format(YourTable.DateField,'ddd') IN ('Sat','Sun');
 
J

John W. Vinson/MVP

Johanna Gronlund said:
Hello,

I need to filter my query for weekend dates only. Is there an easy way of
doing this?

I was going to do a table on excel with all the dates for the time period
with column determining if they are week or weekend date. However, this is
very time consuming and it would be good to know if there is a formula. I
am
not very experienced with formulas in Access so it will need to be spelled
out.

Put a calculated field in your query by typing:

DayOfWeek: Weekday([datefield])

On the Criteria line under this field type

IN(1,7)

The Weekday function returns 1 for Sunday, 2 for Monday,..., 7 for Saturday;
the criterion will select just Sundays and Saturdays.
 
Top