I have Confusion against utilize If,Else Statement against calculation of stock By date. And sort the same by date.
There is real challenge to calculate running total between equal date:
My Table Schema Is:
Suppose If I have Records as Below:
Than Result Should be:
I wants to calculate Inward - outwards = Balance and Balance count as running total as above. but the condition that it should be as per date order by Ascending
How to sort and calculate it by date and transID?
What is transact SQL IN SQL_SERVER-2000?.
There is real challenge to calculate running total between equal date:
My Table Schema Is:
Code:
TransID int, Auto Increment Date datetime, Inwards decimal(12,2) Outward decimal(12,2)
Code:
TransID Date(DD/MM/YYYY) Inward Outward 1 03/02/2011 100 2 12/04/2010 200 3 03/02/2011 400
Code:
TransID Date(DD/MM/YYYY) Inward Outward Balance 2 12/04/2010 200 -200 1 03/02/2011 100 -300 3 03/02/2011 400 100
I wants to calculate Inward - outwards = Balance and Balance count as running total as above. but the condition that it should be as per date order by Ascending
How to sort and calculate it by date and transID?
What is transact SQL IN SQL_SERVER-2000?.
Comment