Kod:
SELECT [PD-TAKIM-HAFTA].SNO, [PD-TAKIM-HAFTA].ATRM, [PD-TAKIM-HAFTA].TARIH, [PD-TAKIM-HAFTA].SEZONK, [PD-TAKIM-HAFTA].TADI1, [PD-TAKIM-HAFTA].S1, [PD-TAKIM-HAFTA].TADI2, [PD-TAKIM-HAFTA].S2,
iif([ATRM]<>dlookup("ATRM","PD-TAKIM-HAFTA","SNO=" & [SNO]-1) or [SEZONK]<>dlookup("SEZONK","PD-TAKIM-HAFTA","SNO=" & [SNO]-1), [G], DSum("G","PD-TAKIM-HAFTA","ATRM='" & [atrm] & "' and SEZONK='" & [SEZONK] & "' and SNO<=" & [SNO])) AS G1,
iif([ATRM]<>dlookup("ATRM","PD-TAKIM-HAFTA","SNO=" & [SNO]-1) or [SEZONK]<>dlookup("SEZONK","PD-TAKIM-HAFTA","SNO=" & [SNO]-1), , DSum("b","PD-TAKIM-HAFTA","ATRM='" & [atrm] & "' and SEZONK='" & [SEZONK] & "' and SNO<=" & [SNO])) AS b1,
iif([ATRM]<>dlookup("ATRM","PD-TAKIM-HAFTA","SNO=" & [SNO]-1) or [SEZONK]<>dlookup("SEZONK","PD-TAKIM-HAFTA","SNO=" & [SNO]-1), [m], DSum("m","PD-TAKIM-HAFTA","ATRM='" & [atrm] & "' and SEZONK='" & [SEZONK] & "' and SNO<=" & [SNO])) AS m1,
iif([ATRM]<>dlookup("ATRM","PD-TAKIM-HAFTA","SNO=" & [SNO]-1) or [SEZONK]<>dlookup("SEZONK","PD-TAKIM-HAFTA","SNO=" & [SNO]-1), [a], DSum("a","PD-TAKIM-HAFTA","ATRM='" & [atrm] & "' and SEZONK='" & [SEZONK] & "' and SNO<=" & [SNO])) AS a1,
iif([ATRM]<>dlookup("ATRM","PD-TAKIM-HAFTA","SNO=" & [SNO]-1) or [SEZONK]<>dlookup("SEZONK","PD-TAKIM-HAFTA","SNO=" & [SNO]-1), [y], DSum("y","PD-TAKIM-HAFTA","ATRM='" & [atrm] & "' and SEZONK='" & [SEZONK] & "' and SNO<=" & [SNO])) AS y1,
[PD-TAKIM-HAFTA].O, [PD-TAKIM-HAFTA].G, [PD-TAKIM-HAFTA].B, [PD-TAKIM-HAFTA].M, [PD-TAKIM-HAFTA].A, [PD-TAKIM-HAFTA].Y INTO [PD-TAKIM-HAFTA-2]
FROM [PD-TAKIM-HAFTA]
ORDER BY [PD-TAKIM-HAFTA].TARIH;