hello all!
Code -
SELECT DatePart('yyyy',[dateSold]) AS yrs, DatePart('q',[dateSold]) AS qtrs, Count(IIf([Product]="Yes",1,Null)) AS Product, Count(IIf([Product="No",1,Null)) AS [Non-Product]
FROM ART
WHERE (((ART.DateSold)>=DateAdd("q",-9,[Enter Date])))
GROUP BY DatePart('yyyy',[dateSold]), DatePart('q',[dateSold])
ORDER BY DatePart('yyyy',[dateSold]), DatePart('q',[dateSold]);
This works fine if I enter today's date, but if I enter a date from the beginning of the year like '3/31/2017' it brings back the previous 9 quarters from that date(nice), but also all quarters of 2017.
What am I missing here - > WHERE (((ART.DateSold)>=DateAdd("q",-9,[Enter Date])))
Thank you!
TD