6
666
I have the following crosstab query:
TRANSFORM CaseTracking.CaseNo AS CaseNo
SELECT DateDiff("ww", [DateForwarded], Date()) AS Weeks
FROM CaseTracking
WHERE (DateDiff("ww", [DateForwarded], Date())>0) AND
(CaseTracking.ForwardedLocation='Org1' OR
CaseTracking.ForwardedLocation='Org2' OR
CaseTracking.ForwardedLocation='Org3' OR
CaseTracking.ForwardedLocation='Org4' OR
CaseTracking.ForwardedLocation='Org5' OR
CaseTracking.ForwardedLocation='Org6')
GROUP BY DateDiff("ww", [DateForwarded], Date()), CaseNo
PIVOT CaseTracking.ForwardedLocation;
This works fine and is used to produce a report with the numbers of weeks a
case file has been at a specfic location as row headers, the location names
as row headers, and the case number as the actual data. As in:
Weeks Org1 Org2 Org3 Org4
1 CASE1 CASE2
2 CASE3
3 CASE2 CASE5
A case may be sent to several locations before it is closed. How can I
change this query so I only get the last location that received a case?
Currently the query returns every location the report went to (as you can
see with CASE2 above). I only want to see how long the file has been at it's
current location.
Hope that makes sense... haven't been able to figure this out... thanx for
any info...
TRANSFORM CaseTracking.CaseNo AS CaseNo
SELECT DateDiff("ww", [DateForwarded], Date()) AS Weeks
FROM CaseTracking
WHERE (DateDiff("ww", [DateForwarded], Date())>0) AND
(CaseTracking.ForwardedLocation='Org1' OR
CaseTracking.ForwardedLocation='Org2' OR
CaseTracking.ForwardedLocation='Org3' OR
CaseTracking.ForwardedLocation='Org4' OR
CaseTracking.ForwardedLocation='Org5' OR
CaseTracking.ForwardedLocation='Org6')
GROUP BY DateDiff("ww", [DateForwarded], Date()), CaseNo
PIVOT CaseTracking.ForwardedLocation;
This works fine and is used to produce a report with the numbers of weeks a
case file has been at a specfic location as row headers, the location names
as row headers, and the case number as the actual data. As in:
Weeks Org1 Org2 Org3 Org4
1 CASE1 CASE2
2 CASE3
3 CASE2 CASE5
A case may be sent to several locations before it is closed. How can I
change this query so I only get the last location that received a case?
Currently the query returns every location the report went to (as you can
see with CASE2 above). I only want to see how long the file has been at it's
current location.
Hope that makes sense... haven't been able to figure this out... thanx for
any info...