question

  • Thread starter Thread starter O....
  • Start date Start date
O

O....

I have a table with Name, PostDate and amount.
John 1/1/2009 10.00
john 1/2/2009 20.00
john 1/3/2009 50.00

I need to subtract the amount from the prior date and so on. almost like a
running total but its the variance i want. thanks
 
SELECT tblPosted.UserName, tblPosted.PostDate, tblPosted.Amount,
nz(DLookUp("Amount","tblPosted","PostDate= #" & [PostDate]-1 & "# AND
UserName='" & [UserName] & "'"),0) AS AmtPrev,
[Amount]-nz(DLookUp("Amount","tblPosted","PostDate= #" & [PostDate]-1 & "#
AND UserName='" & [UserName] & "'"),0) AS Variance
FROM tblPosted;
 
So for those three records what value do you want to see
10, 10, 30
00, 10, 20
or something else?

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
O.... said:
I have a table with Name, PostDate and amount.
John 1/1/2009 10.00
john 1/2/2009 20.00
john 1/3/2009 50.00

I need to subtract the amount from the prior date and so on. almost like
a
running total but its the variance i want. thanks
 
yes I want to see, 10,10,30

John Spencer said:
So for those three records what value do you want to see
10, 10, 30
00, 10, 20
or something else?

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County


.
 
Back
Top