Working days in MS Query

  • Thread starter Thread starter mcquam
  • Start date Start date
M

mcquam

I need to calculate NETWORKDAYS which works fine in Excel but I need to do it
in MS Query. Is there a formula?
 
See if this helps....

This MS Query SQL returns:
The count of workdays (mon thru fri) by Name
from the tblDatesNames table
where dates are between 01-JAN-2008 and 25-JAN-2008

SELECT
tblDatesNames.Name,
Count(tblDatesNames.Date)
FROM `C:\Sandbox1`.tblDatesNames tblDatesNames
WHERE
(weekday(Date) Between 2 And 6)
AND
(tblDatesNames.Date Between cdate('01-JAN-2008') And cdate('25-JAN-2008'))
GROUP BY
tblDatesNames.Name

The returned values list looks like this:

Name Expr1001
Alpha 4
Bravo 4
Charlie 4
Delta 4
Echo 2
Golf 2
Hotel 4
India 4
Juliet 4
Kilo 4
Lima 2

Is that something you can work with?
Post back if you have more questions.

Regards,

Ron
Microsoft MVP - Excel
 

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

Back
Top