Identify Weekdays

C

Chris

I need a query to identify missing weekdays is a list of
dates in a table. I can't write a wuery to identify just
missing dates because I need to excluded weekends.

How should I do this?

-Chris
 
M

Michel Walsh

Hi,


A possible solution is to get all the days, then, exclude the Saturdays and the Sundays with a
simple WHERE clause

WHERE WeekDay(MyDate, 1) IN (2, 3, 4, 5, 6)


Another possibility is to group by week number, and pick us those week having a count of day <>
5:


SELECT DatePart("ww", MyDate), Min(MyDate), Max(MyDate)
FROM Somewhere
GROUP BY DatePart("ww", MyDate)
HAVING COUNT(*) <> 5

That will return you the weeks with a problem (week number, first date known, last date known in
that week)



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top