开发者

Inventory transaction sum for each month

开发者 https://www.devze.com 2022-12-07 21:29 出处:网络
i have a table with detail transaction for lot. Lot are harvest and store before being ship. Datelottransactionqty

i have a table with detail transaction for lot. Lot are harvest and store before being ship.

Date lot transaction qty

5 sept 3 store 300

8 sept 3 ship -50

10 oct 3 ship -20

15 nov 3 ship -20

...

If i want the inventory for a specific moment, i simply sum between to date

I would like a query that can give me a sum from store to a specific month throught the entirr year like:

L开发者_如何学运维ot sept to oct to nov ...

3 250 230 210 ...

Select lot, sum(qty) from ... where (date > 1 sept and date < 1 oct) as sept, (date > 1 sept and date < 1 nov)... group by lot

I did'nt find anything or figure out how to do it i a simple query.

Regards

Obtain one table with a query where is see the evolution of quantity over the year.

0

精彩评论

暂无评论...
验证码 换一张
取 消