Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CrossTab Query & Dates

Status
Not open for further replies.

sara82

Technical User
May 20, 2005
78
US
I have a crosstab query with the following columns which calculates the number of days an employee took to perform a task.

Field: LogDate
Table: tblWorkLog
Total: Count
Corsstab: Value

Is there anyway to exclude weekends and holidays from the value?

I have a table, tblHolidays, with the field, HolidayDate. Is there a function that I can use like the WeekDay and use that with the HolidayDate field so that I can only get the "Work Days"?

 
Thank you for the site. That is referring to 2 dates. I have only one date. I aplogize for not mentioning that.

What's happening is the user logs in and inputs what he did for the day, and the date is logged.

So the crosstab query sums up those days, but I would like to exclude weekends and holidays.
 
Then start from a query like:

Select * from mytable where weekday(logdate) <>1 and weekday(logdate) <>7 and logdate not in (Select HolidayDate from tblholidays)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top