SELECT [W208-02JAN].Field2, [W208-02JAN].Field1, [W208-02JAN].InDate,
[W208-02JAN].[CUSTOMER NAME], [W208-02JAN].ADDRESS, [W208-02JAN].CITY,
[W208-02JAN].ATTENTION, [W208-02JAN].Code, [W208-02JAN].[ACCT NO],
[W208-02JAN].[Cust Prop No], [W208-02JAN].[JOB LOCATION],
[W208-02JAN].PRICE, [W208-02JAN].[CUST NO],
IIf(IsNull([1tot]),[PRICE],IIf(IsNull([2tot]),[PRICE]+[1tot],IIf(IsNull([3tot]),[PRICE]+[1tot]+[2tot],IIf(IsNull([4tot]),[PRICE]+[1tot]+[2tot]+[3tot],IIf(IsNull([5tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot],IIf(IsNull([6tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot],IIf(IsNull([7tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot]+[6tot],[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot]+[6tot]+[7tot])))))))
AS TOT, [W208-02JAN].QTY1, [W208-02JAN].DES1, [W208-02JAN].EA1,
[W208-02JAN].x1, IIf(IsNull([x1]),[QTY1]*[EA1],[x1]) AS 1tot,
[W208-02JAN].QTY2, [W208-02JAN].DES2, [W208-02JAN].EA2, [W208-02JAN].x2,
IIf(IsNull([x2]),[QTY2]*[EA2],[x2]) AS 2tot, [W208-02JAN].QTY3,
[W208-02JAN].DES3, [W208-02JAN].EA3, [W208-02JAN].x3,
IIf(IsNull([x3]),[QTY3]*[EA3],[x3]) AS 3tot, [W208-02JAN].QTY4,
[W208-02JAN].DES4, [W208-02JAN].EA4, [W208-02JAN].x4,
IIf(IsNull([x4]),[QTY4]*[EA4],[x4]) AS 4tot, [W208-02JAN].QTY5,
[W208-02JAN].DES5, [W208-02JAN].EA5, [W208-02JAN].x5,
IIf(IsNull([x5]),[QTY5]*[EA5],[x5]) AS 5tot, [W208-02JAN].QTY6,
[W208-02JAN].DES6, [W208-02JAN].EA6, [W208-02JAN].x6,
IIf(IsNull([x6]),[QTY6]*[EA6],[x6]) AS 6tot, [W208-02JAN].QTY7,
[W208-02JAN].DES7, [W208-02JAN].EA7, [W208-02JAN].x7,
IIf(IsNull([x7]),[QTY7]*[EA7],[x7]) AS 7tot, [W208-02JAN].QTY8,
[W208-02JAN].DES8, [W208-02JAN].EA8, [W208-02JAN].QTY9, [W208-02JAN].DES9,
[W208-02JAN].EA9, [W208-02JAN].QTY10, [W208-02JAN].DES10, [W208-02JAN].EA10,
[W208-02JAN].TOT10 AS Expr1, [W208-02JAN].QTY11, [W208-02JAN].DES11,
[W208-02JAN].EA11, [W208-02JAN].TOT11, [W208-02JAN].QTY12,
[W208-02JAN].DES12, [W208-02JAN].EA12, [W208-02JAN].TOT12,
[W208-02JAN].QTY13, [W208-02JAN].DES13, [W208-02JAN].EA13,
[W208-02JAN].TOT13, [W208-02JAN].QTY14, [W208-02JAN].DES14,
[W208-02JAN].EA14, [W208-02JAN].QTY15, [W208-02JAN].DES15, [W208-02JAN].EA15
FROM [W208-02JAN]
GROUP BY [W208-02JAN].Field2, [W208-02JAN].Field1, [W208-02JAN].InDate,
[W208-02JAN].[CUSTOMER NAME], [W208-02JAN].ADDRESS, [W208-02JAN].CITY,
[W208-02JAN].ATTENTION, [W208-02JAN].Code, [W208-02JAN].[ACCT NO],
[W208-02JAN].[Cust Prop No], [W208-02JAN].[JOB LOCATION],
[W208-02JAN].PRICE, [W208-02JAN].[CUST NO],
IIf(IsNull([1tot]),[PRICE],IIf(IsNull([2tot]),[PRICE]+[1tot],IIf(IsNull([3tot]),[PRICE]+[1tot]+[2tot],IIf(IsNull([4tot]),[PRICE]+[1tot]+[2tot]+[3tot],IIf(IsNull([5tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot],IIf(IsNull([6tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot],IIf(IsNull([7tot]),[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot]+[6tot],[PRICE]+[1tot]+[2tot]+[3tot]+[4tot]+[5tot]+[6tot]+[7tot]))))))),
[W208-02JAN].QTY1, [W208-02JAN].DES1, [W208-02JAN].EA1, [W208-02JAN].x1,
IIf(IsNull([x1]),[QTY1]*[EA1],[x1]), [W208-02JAN].QTY2, [W208-02JAN].DES2,
[W208-02JAN].EA2, [W208-02JAN].x2, IIf(IsNull([x2]),[QTY2]*[EA2],[x2]),
[W208-02JAN].QTY3, [W208-02JAN].DES3, [W208-02JAN].EA3, [W208-02JAN].x3,
IIf(IsNull([x3]),[QTY3]*[EA3],[x3]), [W208-02JAN].QTY4, [W208-02JAN].DES4,
[W208-02JAN].EA4, [W208-02JAN].x4, IIf(IsNull([x4]),[QTY4]*[EA4],[x4]),
[W208-02JAN].QTY5, [W208-02JAN].DES5, [W208-02JAN].EA5, [W208-02JAN].x5,
IIf(IsNull([x5]),[QTY5]*[EA5],[x5]), [W208-02JAN].QTY6, [W208-02JAN].DES6,
[W208-02JAN].EA6, [W208-02JAN].x6, IIf(IsNull([x6]),[QTY6]*[EA6],[x6]),
[W208-02JAN].QTY7, [W208-02JAN].DES7, [W208-02JAN].EA7, [W208-02JAN].x7,
IIf(IsNull([x7]),[QTY7]*[EA7],[x7]), [W208-02JAN].QTY8, [W208-02JAN].DES8,
[W208-02JAN].EA8, [W208-02JAN].QTY9, [W208-02JAN].DES9, [W208-02JAN].EA9,
[W208-02JAN].QTY10, [W208-02JAN].DES10, [W208-02JAN].EA10,
[W208-02JAN].TOT10, [W208-02JAN].QTY11, [W208-02JAN].DES11,
[W208-02JAN].EA11, [W208-02JAN].TOT11, [W208-02JAN].QTY12,
[W208-02JAN].DES12, [W208-02JAN].EA12, [W208-02JAN].TOT12,
[W208-02JAN].QTY13, [W208-02JAN].DES13, [W208-02JAN].EA13,
[W208-02JAN].TOT13, [W208-02JAN].QTY14, [W208-02JAN].DES14,
[W208-02JAN].EA14, [W208-02JAN].QTY15, [W208-02JAN].DES15, [W208-02JAN].EA15
HAVING ((([W208-02JAN].InDate)="208-03"))
ORDER BY [W208-02JAN].Code, [W208-02JAN].[ACCT NO], [W208-02JAN].[Cust Prop
No];