T
Ticotion
Hi
I have a problem calculating a runing sum for a field in a query. As far as
I can read I need to use a subquery but I can not get this to work. I need to
calculate a runing sum on the field [Hyp procent]
My SQL query is
PARAMETERS [ [Forms]![frmSIMpareto]![Kombinationsboks7]] DateTime, [
[Forms]![frmSIMpareto]![Combo38]] DateTime,
[Forms]![frmSIMpareto]![Kombinationsboks16] Long;
SELECT qrySIM2sektor.Dato, qrySIM2sektor.Sektor, [Maskin navn]+"
"+[Afvigelsetekst] AS Fejlårsag, Sum(qrySIM2sektor.[Fejlen hyppighed]) AS
[Fejlen hyppighed], qrySimSektorparetototal.[Hyp total], Round(([Fejlen
hyppighed]/[Hyp total])*100,1) AS [Hyp procent]
FROM qrySimSektorparetototal INNER JOIN qrySIM2sektor ON
(qrySimSektorparetototal.Sektor = qrySIM2sektor.Sektor) AND
(qrySimSektorparetototal.Dato = qrySIM2sektor.Dato)
GROUP BY qrySIM2sektor.Dato, qrySIM2sektor.Sektor, [Maskin navn]+"
"+[Afvigelsetekst], qrySimSektorparetototal.[Hyp total], Round(([Fejlen
hyppighed]/[Hyp total])*100,1)
HAVING (((qrySIM2sektor.Dato) Between
[Forms]![frmSIMpareto]![Kombinationsboks7] And
[Forms]![frmSIMpareto]![Combo38]) AND
((qrySIM2sektor.Sektor)=[Forms]![frmSIMpareto]![Kombinationsboks16]))
ORDER BY qrySIM2sektor.Dato, Sum(qrySIM2sektor.[Fejlen hyppighed]) DESC;
Help please
Ticotion
I have a problem calculating a runing sum for a field in a query. As far as
I can read I need to use a subquery but I can not get this to work. I need to
calculate a runing sum on the field [Hyp procent]
My SQL query is
PARAMETERS [ [Forms]![frmSIMpareto]![Kombinationsboks7]] DateTime, [
[Forms]![frmSIMpareto]![Combo38]] DateTime,
[Forms]![frmSIMpareto]![Kombinationsboks16] Long;
SELECT qrySIM2sektor.Dato, qrySIM2sektor.Sektor, [Maskin navn]+"
"+[Afvigelsetekst] AS Fejlårsag, Sum(qrySIM2sektor.[Fejlen hyppighed]) AS
[Fejlen hyppighed], qrySimSektorparetototal.[Hyp total], Round(([Fejlen
hyppighed]/[Hyp total])*100,1) AS [Hyp procent]
FROM qrySimSektorparetototal INNER JOIN qrySIM2sektor ON
(qrySimSektorparetototal.Sektor = qrySIM2sektor.Sektor) AND
(qrySimSektorparetototal.Dato = qrySIM2sektor.Dato)
GROUP BY qrySIM2sektor.Dato, qrySIM2sektor.Sektor, [Maskin navn]+"
"+[Afvigelsetekst], qrySimSektorparetototal.[Hyp total], Round(([Fejlen
hyppighed]/[Hyp total])*100,1)
HAVING (((qrySIM2sektor.Dato) Between
[Forms]![frmSIMpareto]![Kombinationsboks7] And
[Forms]![frmSIMpareto]![Combo38]) AND
((qrySIM2sektor.Sektor)=[Forms]![frmSIMpareto]![Kombinationsboks16]))
ORDER BY qrySIM2sektor.Dato, Sum(qrySIM2sektor.[Fejlen hyppighed]) DESC;
Help please
Ticotion