G
Guest
When I try run the following query I get an overflow error -
SELECT DateConvPt2.MonthYear, LocRef.LocCode, RevItem.RevItem,
SlitSales.Width, RollLengthCalc.NormLength, Sum(SlitSales.[#Cheeses]) AS
[SumOf#Cheeses]
FROM (LocRef RIGHT JOIN ((SlitSales INNER JOIN DateConvPt2 ON SlitSales.ID =
DateConvPt2.ID) INNER JOIN RevItem ON SlitSales.ID = RevItem.ID) ON
LocRef.Entity = SlitSales.Entity) INNER JOIN RollLengthCalc ON SlitSales.ID =
RollLengthCalc.ID
GROUP BY DateConvPt2.MonthYear, LocRef.LocCode, RevItem.RevItem,
SlitSales.Width, RollLengthCalc.NormLength;
I have tried to narrow the problem down and found that the
RollLengthCalc.NormLength field is the problem. I can remove or add as many
other fields as I like but as soon as this field is included I get the
overflow error and as soon as I remove this field the query runs fine.
Below is the SQL that creates this suspect field -
SELECT SlitSales.ID,
([SlitSales]![M2]/[SlitSales]![#Cheeses])/([SlitSales]![Width]/1000) AS
AvgLength, IIf([AvgLength]<700,"<700",IIf([AvgLength]>=700 And
[AvgLength]<=1250,"1000",IIf([AvgLength]>=1251 And
[AvgLength]<=1750,"1500",IIf([AvgLength]>=1751 And
[AvgLength]<=2249,"2000",IIf([AvgLength]>=2250 And
[AvgLength]<=2750,"2500",IIf([AvgLength]>=2751 And
[AvgLength]<=3300,"3000","other")))))) AS NormLength
FROM SlitSales;
What have I screwed up?
SELECT DateConvPt2.MonthYear, LocRef.LocCode, RevItem.RevItem,
SlitSales.Width, RollLengthCalc.NormLength, Sum(SlitSales.[#Cheeses]) AS
[SumOf#Cheeses]
FROM (LocRef RIGHT JOIN ((SlitSales INNER JOIN DateConvPt2 ON SlitSales.ID =
DateConvPt2.ID) INNER JOIN RevItem ON SlitSales.ID = RevItem.ID) ON
LocRef.Entity = SlitSales.Entity) INNER JOIN RollLengthCalc ON SlitSales.ID =
RollLengthCalc.ID
GROUP BY DateConvPt2.MonthYear, LocRef.LocCode, RevItem.RevItem,
SlitSales.Width, RollLengthCalc.NormLength;
I have tried to narrow the problem down and found that the
RollLengthCalc.NormLength field is the problem. I can remove or add as many
other fields as I like but as soon as this field is included I get the
overflow error and as soon as I remove this field the query runs fine.
Below is the SQL that creates this suspect field -
SELECT SlitSales.ID,
([SlitSales]![M2]/[SlitSales]![#Cheeses])/([SlitSales]![Width]/1000) AS
AvgLength, IIf([AvgLength]<700,"<700",IIf([AvgLength]>=700 And
[AvgLength]<=1250,"1000",IIf([AvgLength]>=1251 And
[AvgLength]<=1750,"1500",IIf([AvgLength]>=1751 And
[AvgLength]<=2249,"2000",IIf([AvgLength]>=2250 And
[AvgLength]<=2750,"2500",IIf([AvgLength]>=2751 And
[AvgLength]<=3300,"3000","other")))))) AS NormLength
FROM SlitSales;
What have I screwed up?