Calculate Difference

Z

zyus

I hv this sample report that sorted by MIA

MIA Bal Diff
1 100 200-100=100
2 200 500-200=300
3 500

Q. How to calculate difference of bal amount by MIA as per Diff as above...

Thanks
 
S

scubadiver

Give this a go

SELECT MIA, Diff AS New,
(SELECT Max([Total]) FROM table AS temp
WHERE temp.mia=table.mia-1) AS Old, ([bal]-[old]) AS diff
FROM table
 

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