Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

How to get the closing stock calculation in sql

$
0
0

How to write the sql query calculating the closing stock .

Closing Stock : Opening Stock - other (order_type_desc) 

group by period_key

See Screenshots :

In the above example :

Closing Stock will be : 3375 - (-3498+29821)

There can be other order_type_desc as well . See another example screenshot :

In this example 

Closing Stock : Opening Balance - Sales

How to write a view in SQL SERVER 2005

Thanks,


Viewing all articles
Browse latest Browse all 4729

Trending Articles



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