question

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
 
S

S.Clark

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;
 
J

John Spencer

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
 
M

MONICA GARCIA

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
 
O

O....

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


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top