I have 2 joined tables but I am trying to get a query where items sold greater than 6 months ago but less than 1 year within this query. I seem to be having trouble obtaining this.
SELECT SOLAR_CustItem.[Part Number], SOLAR_CustItem.[Description 1], SOLAR_INVENTORY.[Item Code], SOLAR_INVENTORY.[Free Stock (in Eaches)], SOLAR_CustItem.[Sales Unit Price], SOLAR_CustItem.[Sales Unit], [Free Stock (in Eaches)]*[Sales Unit Price] AS [Inventory $], SOLAR_INVENTORY.[Date of Last Sale], SOLAR_INVENTORY.[Date of Last Purchase]
FROM SOLAR_CustItem INNER JOIN SOLAR_INVENTORY ON SOLAR_CustItem.[Item Code] = SOLAR_INVENTORY.[Item Code]
WHERE (((SOLAR_INVENTORY.[Date of Last Sale])>-180 And (SOLAR_INVENTORY.[Date of Last Sale])>-365))
GROUP BY SOLAR_CustItem.[Part Number], SOLAR_CustItem.[Description 1], SOLAR_INVENTORY.[Item Code], SOLAR_INVENTORY.[Free Stock (in Eaches)], SOLAR_CustItem.[Sales Unit Price], SOLAR_CustItem.[Sales Unit], SOLAR_INVENTORY.[Date of Last Sale], SOLAR_INVENTORY.[Date of Last Purchase];
Obviously, I need to have the >-180 to be a "<". But I get no data in return from this.
Thank you,
SELECT SOLAR_CustItem.[Part Number], SOLAR_CustItem.[Description 1], SOLAR_INVENTORY.[Item Code], SOLAR_INVENTORY.[Free Stock (in Eaches)], SOLAR_CustItem.[Sales Unit Price], SOLAR_CustItem.[Sales Unit], [Free Stock (in Eaches)]*[Sales Unit Price] AS [Inventory $], SOLAR_INVENTORY.[Date of Last Sale], SOLAR_INVENTORY.[Date of Last Purchase]
FROM SOLAR_CustItem INNER JOIN SOLAR_INVENTORY ON SOLAR_CustItem.[Item Code] = SOLAR_INVENTORY.[Item Code]
WHERE (((SOLAR_INVENTORY.[Date of Last Sale])>-180 And (SOLAR_INVENTORY.[Date of Last Sale])>-365))
GROUP BY SOLAR_CustItem.[Part Number], SOLAR_CustItem.[Description 1], SOLAR_INVENTORY.[Item Code], SOLAR_INVENTORY.[Free Stock (in Eaches)], SOLAR_CustItem.[Sales Unit Price], SOLAR_CustItem.[Sales Unit], SOLAR_INVENTORY.[Date of Last Sale], SOLAR_INVENTORY.[Date of Last Purchase];
Obviously, I need to have the >-180 to be a "<". But I get no data in return from this.
Thank you,