G
Guest
Here is the data from my query:
ID Status RosterDate Number Difference
1 ACTIVE 5/15/2006 835
2 INACTIVE 5/15/2006 71 -764
3 ACTIVE 5/29/2006 852
4 INACTIVE 5/29/2006 75 4
Here is my sql:
SELECT tblStats.ID, tblStats.RosterDate, tblStats.Status, tblStats.Number,
[tblStats].[Number]-(SELECT TOP 1 Dupe.Number FROM [tblStats] AS Dupe WHERE
Dupe.ID < [tblStats].ID and [tblStats].Status='INACTIVE' Order BY
Dupe.Status DESC) AS Difference
FROM tblStats;
What I need to do is group these records by Status. I also need to calculate
the difference for te Actives. And that -764 should not be there, ir should
be zero, because there was no prior week.
Thanks in advance for your assistance.
ID Status RosterDate Number Difference
1 ACTIVE 5/15/2006 835
2 INACTIVE 5/15/2006 71 -764
3 ACTIVE 5/29/2006 852
4 INACTIVE 5/29/2006 75 4
Here is my sql:
SELECT tblStats.ID, tblStats.RosterDate, tblStats.Status, tblStats.Number,
[tblStats].[Number]-(SELECT TOP 1 Dupe.Number FROM [tblStats] AS Dupe WHERE
Dupe.ID < [tblStats].ID and [tblStats].Status='INACTIVE' Order BY
Dupe.Status DESC) AS Difference
FROM tblStats;
What I need to do is group these records by Status. I also need to calculate
the difference for te Actives. And that -764 should not be there, ir should
be zero, because there was no prior week.
Thanks in advance for your assistance.