I was wondering if anyone can help me change the following query to include a range. I have to change it to aggregate forecast and need include the last 4 months instead of just the last month. How do I change this to a between statement? It is the bold part that need to be date range.
SELECT DISTINCT [ZZZ2 - Item Master Table (MRP and MPS and Other Items)].[Trend Type], Forcst.[Trend Description], History.[Mktg Mgr], History.Part, History.Amount_Hist3, Forcst.Amount_Fcst1, History.Month_Hist3, Forcst.Month_Fcst1, History.Intl_Dom
FROM [ZZZ2 - Item Master Table (MRP and MPS and Other Items)] RIGHT JOIN (History LEFT JOIN Forcst ON History.Part = Forcst.Part) ON [ZZZ2 - Item Master Table (MRP and MPS and Other Items)].[Part Number] = History.Part
WHERE (((History.Month_Hist3)=[Month (Last) - mm/dd/yy]) AND ((Forcst.Month_Fcst1)=[Month (Last) - mm/dd/yy]) AND ((History.Intl_Dom)="Dom") AND ((Forcst.Intl_Dom)="Dom"));
Thanks a bunch!
JCA
SELECT DISTINCT [ZZZ2 - Item Master Table (MRP and MPS and Other Items)].[Trend Type], Forcst.[Trend Description], History.[Mktg Mgr], History.Part, History.Amount_Hist3, Forcst.Amount_Fcst1, History.Month_Hist3, Forcst.Month_Fcst1, History.Intl_Dom
FROM [ZZZ2 - Item Master Table (MRP and MPS and Other Items)] RIGHT JOIN (History LEFT JOIN Forcst ON History.Part = Forcst.Part) ON [ZZZ2 - Item Master Table (MRP and MPS and Other Items)].[Part Number] = History.Part
WHERE (((History.Month_Hist3)=[Month (Last) - mm/dd/yy]) AND ((Forcst.Month_Fcst1)=[Month (Last) - mm/dd/yy]) AND ((History.Intl_Dom)="Dom") AND ((Forcst.Intl_Dom)="Dom"));
Thanks a bunch!
JCA