Microsoft
Software
Hardware
Network
Question : Mysql CASE HELP - MARGIN CALC
Hi i have this sum
round((sum((h.unitsell * h.quantity) - h.bulkdiscount)/1.1 - sum(h.unitcostex)) / (sum((h.unitsell * h.quantity) - h.bulkdiscount)/1.1) * 100,2) as MARGIN,
I need it in a case when statement
when h.subtranstype <'4' then...
I cant get it with out error
Heres my try
sum(case when h.subtranstype < '4' then (((h.unitsell * h.quantity) - h.bulkdiscount)/1.1 - (h.unitcostex)) / (sum((h.unitsell * h.quantity) - h.bulkdiscount)/1.1) * 100) else 0 end) as MARGIN,
CAn anyone help me out, I can't get the (BRACKETS) right
THanks
Answer : Mysql CASE HELP - MARGIN CALC
Round(sum(case when h.subtranstype < '4' then
(
(
(
(h.unitsell * h.quantity
)
- h.bulkdiscount
)/1.1
) - h.unitcostex
) /
(
(
(h.unitsell * h.quantity
)
- h.bulkdiscount
) /1.1
)
Else 0 end
) * 100.00 , 2) as Margin
Random Solutions
Advanced Facebook Fan Page Formatting
help calling javascript function
Controlling Exchange 2010 port usage + some mythbusting
Can I use a sql query file (.sql) with bcp.exe?
bootable usb
How do I avoid double quotation marks by using comma in Acrobat Acrobat v.9.x
How to convert non ansi outer join =* to ansi outer join
Microsoft.sqlserver.manage
ment .net 4 help
Access VBA - best way to get field value based on ID
Downgrade office 2010 to office 2007