G
Guest
I am using MIcrosoft's code to begin with and tweaked it to fit my needs,
but
the code only works when the number is incrementing, I need help tweaking the
code to take into account that the number may decrease. Here is my sql:
SELECT Inactive1.RosterDate, Inactive1.Inactive, (Select Max(Inactive) from
tblClinicalLiasonAnalysis Where Inactive < Inactive1.[Inactive] ) AS
PrevInactive, [Inactive]-[PrevInactive] AS [Number], [Number]/[PrevInactive]
AS [Percent], Inactive1.Active, (Select Max(Active) from
tblClinicalLiasonAnalysis Where Active < Inactive1.[Active]) AS PrevActive,
[Active]-[PrevActive] AS NumberA, [NumberA]/[PrevActive] AS PercentA
FROM tblClinicalLiasonAnalysis AS Inactive1;
Like I said, everything works fine as long as Inactive and Active are
increasing from one record to the next, my dilema is how to take into account
a decrease from one record to the next.
Thanks
but
the code only works when the number is incrementing, I need help tweaking the
code to take into account that the number may decrease. Here is my sql:
SELECT Inactive1.RosterDate, Inactive1.Inactive, (Select Max(Inactive) from
tblClinicalLiasonAnalysis Where Inactive < Inactive1.[Inactive] ) AS
PrevInactive, [Inactive]-[PrevInactive] AS [Number], [Number]/[PrevInactive]
AS [Percent], Inactive1.Active, (Select Max(Active) from
tblClinicalLiasonAnalysis Where Active < Inactive1.[Active]) AS PrevActive,
[Active]-[PrevActive] AS NumberA, [NumberA]/[PrevActive] AS PercentA
FROM tblClinicalLiasonAnalysis AS Inactive1;
Like I said, everything works fine as long as Inactive and Active are
increasing from one record to the next, my dilema is how to take into account
a decrease from one record to the next.
Thanks