Calculate days less than X as percentage of total turn around time

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hi everyone:

I am trying to accomplish this task: I have a query that shows turn around
times in days. The days range from 0 to 34 days. What do I need to do or how
do I show the number of days less that 9 and display that number as a
percentage of the over all time around time?

Thanks for you help.
 
You'll need a query to sum the days that are <= 9
SELECT Sum(qryTurnAroundDays.TurnAroundDays) AS SumOfTurnAroundDays9
FROM qryTurnAroundDays
WHERE (((qryTurnAroundDays.TurnAroundDays)<=9));

You'll need a query to sum all the days
SELECT Sum(qryTurnAroundDays.TurnAroundDays) AS SumOfTurnAroundDays
FROM qryTurnAroundDays


Finally you'll need a query that divides the values from the first query
with the value from the second query
SumOfTurnAroundDays9 / SumOfTurnAroundDays
 
Thank you S. Clark,

I thought about doing exactly what you've suggested but discarded the idea
because I was hoping there was another way. I appreciated your response.

Have a great day!
 
SELECT Sum(IIF(DayRange<9,DayRange,Null)) as SumUnder9
, Sum(DayRange) as TotalDays
, Sum(IIF(DayRange<9,DayRange,Null))/ Sum(DayRange) as PerCentHours
FROM YourTable

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Back
Top