P
patti
i inherited database. this query has me baffled.
TRANSFORM Sum([po qty]-[last rct qty]) AS [OO Qty]
SELECT [Description Table].Style, [Description Table].[Long Style], [On
Order].PO, [On Order].[New Req Date]
FROM ([On Order] INNER JOIN [Description Table] ON [On Order].[Long Style] =
[Description Table].[Long Style]) INNER JOIN [Month Table-Week Range] ON [On
Order].[New Req Date] = [Month Table-Week Range].DATE
WHERE ((([On Order].[New Req
Date])>=DateSerial(Year(DateAdd("m",-3,Date())),Month(Date())-3,1)))
GROUP BY [Description Table].Style, [Description Table].[Long Style], [On
Order].PO, [On Order].[New Req Date]
PIVOT DateDiff("m",Date(),[New Req Date])+IIf(DatePart("d",Date())>25,5,4)
In (1,2,3,4,5,6,7,8,9,10,11,12);
it want january's sum to end up in column 3 but it is ending up in column 5.
[new req date] will push to next month if day greater than the 25th.
thanks for any help.
TRANSFORM Sum([po qty]-[last rct qty]) AS [OO Qty]
SELECT [Description Table].Style, [Description Table].[Long Style], [On
Order].PO, [On Order].[New Req Date]
FROM ([On Order] INNER JOIN [Description Table] ON [On Order].[Long Style] =
[Description Table].[Long Style]) INNER JOIN [Month Table-Week Range] ON [On
Order].[New Req Date] = [Month Table-Week Range].DATE
WHERE ((([On Order].[New Req
Date])>=DateSerial(Year(DateAdd("m",-3,Date())),Month(Date())-3,1)))
GROUP BY [Description Table].Style, [Description Table].[Long Style], [On
Order].PO, [On Order].[New Req Date]
PIVOT DateDiff("m",Date(),[New Req Date])+IIf(DatePart("d",Date())>25,5,4)
In (1,2,3,4,5,6,7,8,9,10,11,12);
it want january's sum to end up in column 3 but it is ending up in column 5.
[new req date] will push to next month if day greater than the 25th.
thanks for any help.