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

Sum of quantity according to the date

$
0
0
 

Hi Everyone,

we have a table  as given below

select  [Entry No_]
       ,[Item No_]
      ,[Posting Date]
      ,[Entry Type]
      ,[Document Type]
      ,[Document No_]
      [Description]
      ,[Location Code]
      ,[Quantity]
 FROM [bckup].[dbo].[ItemLedgerEntry]  

I want to calculate date wise stock means per day stock , the logic is if we select 3 in [Posting Date] then according to [Location Code], [Item No_] and [Entry Type]  [Quantity] should be sum([Quantity] ) From 1st [Posting Date] to 3 as usually for each date . 

means the quantity should be accumulate according to each  [Posting Date]

Please anyone help me because I'm new in sql server .

Thanks in advance


 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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