Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

TSQL to find the date difference between two rows of same column

$
0
0

Hello everyone,

I have scenario, in which I need to group set of data from table based on ID, price , quantity and if the start date between the records is successive)

In the below mentioned record, I need find if ID, quantity and price is matching between successive records months records and get the sum of amount.

IDStart DateEnd DatequantitypriceAmount 
201/01/1301/31/1341000031000
202/01/1302/28/1341000028000
203/01/1303/31/1361000031000
204/01/1304/30/13410000  31000   

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>