Exlude Saturdays and Sundays

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

I need to exclude from my report based on the query dates that fall on
Saturdays and Sundays. My field's name is : DateNoSwipe format dd/mm/yyyy.

Can you assist?

Anna
 
Put the following criteria in the DateNoSwipe field in your query:
<> VBSaturday And <> VBSunday

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Hello:

I need to exclude from my report based on the query dates that fall on
Saturdays and Sundays. My field's name is : DateNoSwipe format dd/mm/yyyy.

Can you assist?

Anna

Anna,

One way to do this would be to create a field in your query to return
the number of the day of the week for each date. The use criteria to
exclude values of 1 and 7 which represent Sunday and Saturday
respectively.

In your query you can use:

WkDay: Weekday([dateval]) as the field
and:
<>1 And <>7 as the criteia for this field.

This will only return dates that did not occur on Saturday or Sunday.

HTH

Mr. B
 
Hello:

Thanks so much - it works perfectly well.
--
Anna


Mr. B said:
Hello:

I need to exclude from my report based on the query dates that fall on
Saturdays and Sundays. My field's name is : DateNoSwipe format dd/mm/yyyy.

Can you assist?

Anna

Anna,

One way to do this would be to create a field in your query to return
the number of the day of the week for each date. The use criteria to
exclude values of 1 and 7 which represent Sunday and Saturday
respectively.

In your query you can use:

WkDay: Weekday([dateval]) as the field
and:
<>1 And <>7 as the criteia for this field.

This will only return dates that did not occur on Saturday or Sunday.

HTH

Mr. B
 
Hi :

I used the function proposed by Mr B (next reply) but I ak sure I could also
use this mehtod.
 
There isn't enough info in your post to give much detail, but the basic
logic is:

if weekday(#6/9/2007#, vbMonday) > 5 Then
msgbox "WeekEnd"
End If
 
Back
Top