Interpreting SUMIf in excel sql
Question
I have this SUMIF =SUMIF(WEZ_ARTICLE_PLANT!A:A,$E2,WEZ_ARTICLE_PLANT!AX:AX)
I want do the same as the sumif in sql excel.
In my query
WEZ_ARTICLE_PLANT!A:A = column_Material
$E2 = column_Material
WEZ_ARTICLE_PLANT!AX:AX = column_StockQty
I would be glad for any Responce!
Solution
you will have to start thinking of things in a slightly different way now that you are working with a database.
SELECT column_Material, SUM(column_StockQuantity)
FROM YouTableName
GROUP BY column_Material
will give you a total of all quantities for each column_Material
OTHER TIPS
You mean something like this?
Select sum(column_StockQty) from table_Name where column_Material = 'Example'
Perhaps you mean a case statement?
Sum (CASE WHEN <SOME CRITERIA> then <YOUR COLUMN> else <NULL or SOME OTHER COLUMN> END) AS ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow