kentwoodjean
Technical User
OK, I give up and need a bit of help or I will never get this done. Have a report that I need to calculate 12 months rolling data. While trying to use the same format I used for a different query, it is not working. So, have 2 problems: (1) 12 month rolling formula is not working and is only picking up the current month and (2) how do I get the reasons that are not in use by a person to stop showing in the crosstab and only show those that are being using by the individual [DESC]. Maybe if I get the rolling 12 months working, problem 2 will not be there.
Here is my SQL on my query and what I have thus Far. This is the query that will build my crosstab. My other working query for rolling 12 months has the DateSerial formula following "Date" (get just April 2005 using that) as well as criteria under the Date Field column (get nothing using this).
SELECT [WMI LNN EMP DETAIL 92660].EMPID, [WMI LNN EMP DETAIL 92660].OPID, [WMI LNN EMP DETAIL 92660].DESC, [WMI LNN EMP DETAIL 92660].DATE, [WMI LNN EMP DETAIL 92660].Lost, [WMI LNN EMP DETAIL 92660].EMPLSTNAME, DateSerial((Year(Now())-1),IIf(Month(Now())=1,12,Month(Now())-1),1) AS [Date]
FROM [WMI LNN EMP DETAIL 92660]
WHERE ((([WMI LNN EMP DETAIL 92660].SECTID)="62"))
GROUP BY [WMI LNN EMP DETAIL 92660].EMPID, [WMI LNN EMP DETAIL 92660].OPID, [WMI LNN EMP DETAIL 92660].DESC, [WMI LNN EMP DETAIL 92660].DATE, [WMI LNN EMP DETAIL 92660].Lost, [WMI LNN EMP DETAIL 92660].EMPLSTNAME, DateSerial((Year(Now())-1),IIf(Month(Now())=1,12,Month(Now())-1),1)
HAVING ((([WMI LNN EMP DETAIL 92660].DATE) Between (DateSerial((Year(Now())-1),Month(Now()),1)) And (DateSerial((Year(Now())),IIf(Month(Now())=1,12,Month(Now())-0),1))));
Here is my SQL on my query and what I have thus Far. This is the query that will build my crosstab. My other working query for rolling 12 months has the DateSerial formula following "Date" (get just April 2005 using that) as well as criteria under the Date Field column (get nothing using this).
SELECT [WMI LNN EMP DETAIL 92660].EMPID, [WMI LNN EMP DETAIL 92660].OPID, [WMI LNN EMP DETAIL 92660].DESC, [WMI LNN EMP DETAIL 92660].DATE, [WMI LNN EMP DETAIL 92660].Lost, [WMI LNN EMP DETAIL 92660].EMPLSTNAME, DateSerial((Year(Now())-1),IIf(Month(Now())=1,12,Month(Now())-1),1) AS [Date]
FROM [WMI LNN EMP DETAIL 92660]
WHERE ((([WMI LNN EMP DETAIL 92660].SECTID)="62"))
GROUP BY [WMI LNN EMP DETAIL 92660].EMPID, [WMI LNN EMP DETAIL 92660].OPID, [WMI LNN EMP DETAIL 92660].DESC, [WMI LNN EMP DETAIL 92660].DATE, [WMI LNN EMP DETAIL 92660].Lost, [WMI LNN EMP DETAIL 92660].EMPLSTNAME, DateSerial((Year(Now())-1),IIf(Month(Now())=1,12,Month(Now())-1),1)
HAVING ((([WMI LNN EMP DETAIL 92660].DATE) Between (DateSerial((Year(Now())-1),Month(Now()),1)) And (DateSerial((Year(Now())),IIf(Month(Now())=1,12,Month(Now())-0),1))));