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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Work week only 4 days 3

Status
Not open for further replies.

netrusher

Technical User
Joined
Feb 13, 2005
Messages
952
Location
US
I have two queries below that give me Number of Unique days from a date
range and number of gauges calibrated in that same date range. The totals
are skewed however due to the fact that the date range is covering 7 days
per week when in fact the work week is only 4 days, Monday-Thursday. I
somehow need to factor in this work week of 4 days. Does anyone have
any suggestions as to how I can accomplish this?

Code:
SELECT Sum(IIf(([Date Due] Is Not Null),1,0)) AS Gages
FROM [All gages]
WHERE ((([All gages].[DATE DUE]) Between [Forms]![DateRangeQueryForm]!
[StartDateTxt] And [Forms]![DateRangeQueryForm]![EndDateTxt]));

Code:
SELECT Count(UniqueDaysAll.[DATE DUE]) AS [CountOfDATE DUE]
FROM UniqueDaysAll;
 
add
Code:
And Weekday([due date]) between 2 and 4
 
Between 2 and 5 might include Thursday. [smile]

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
traingamer:

you are right have a star
 
on the other hand, the first query included (input) parameters, which could just as easily be applied to both - and provide "correct" results without potentially skewing the data in either drection?



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top