L
lottaviano
Hi everyone,
I have a query that reads as follows:
SELECT EQUIP_NAME, DatePart("ww",Starting),
DatePart("yyyy",Starting),
round(Nz(7-SUM(iif(Nz(Ending >[UP DATE TIME], false),[UP DATE
TIME],Ending) - iif(Nz(Starting>[DOWN DATE TIME], false),Starting,
[DOWN DATE TIME]) ), 0)/7,4)
FROM Dates AS a LEFT JOIN [Coat Only for Uptime] AS b ON (a.Starting <
b.[UP DATE TIME]) AND (a.Ending > b.[DOWN DATE TIME])
GROUP BY EQUIP_NAME, DatePart("ww",Starting),
DatePart("yyyy",Starting);
The purpose of it is to use a table (Coat Only for Uptime) containing
times equipment was put down (taken out of service) and put back up
(returned to service) to calculate the percent of the WorkWeek the
equipment was Up. (100% up is good)
The table Dates only contains two fields: Starting and Ending. All
they are is a series of all dates. Starting: 10/22/07, Ending
10/23/07. Starting 10/23/07, Ending 10/24/07. And so on for every
day of the year.
I want the pivotchart to show percent uptime per workweek with no
gaps. Right now, if there is no data for a given workweek (the
equipment was neither taken down nor put up during that week), then
there is no marker on the chart for that week. It should be 100%
because it was up the whole week. How do I get the chart to reflect
that?
Thanks very much,
Liana Ottaviano
Bend, Oregon
I have a query that reads as follows:
SELECT EQUIP_NAME, DatePart("ww",Starting),
DatePart("yyyy",Starting),
round(Nz(7-SUM(iif(Nz(Ending >[UP DATE TIME], false),[UP DATE
TIME],Ending) - iif(Nz(Starting>[DOWN DATE TIME], false),Starting,
[DOWN DATE TIME]) ), 0)/7,4)
FROM Dates AS a LEFT JOIN [Coat Only for Uptime] AS b ON (a.Starting <
b.[UP DATE TIME]) AND (a.Ending > b.[DOWN DATE TIME])
GROUP BY EQUIP_NAME, DatePart("ww",Starting),
DatePart("yyyy",Starting);
The purpose of it is to use a table (Coat Only for Uptime) containing
times equipment was put down (taken out of service) and put back up
(returned to service) to calculate the percent of the WorkWeek the
equipment was Up. (100% up is good)
The table Dates only contains two fields: Starting and Ending. All
they are is a series of all dates. Starting: 10/22/07, Ending
10/23/07. Starting 10/23/07, Ending 10/24/07. And so on for every
day of the year.
I want the pivotchart to show percent uptime per workweek with no
gaps. Right now, if there is no data for a given workweek (the
equipment was neither taken down nor put up during that week), then
there is no marker on the chart for that week. It should be 100%
because it was up the whole week. How do I get the chart to reflect
that?
Thanks very much,
Liana Ottaviano
Bend, Oregon