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
Joomla CiviCRM problem
How to get a Dell D800 to load Bios fully?
DROID-ActiveSync Issue
PHP Array: Only the first item in array is returned
AP running G and N
accessing a web service
I can send e-mail ok but cannot get to Internet via browser
Control object destruction during global destruction
how can i find all ILO boards on a network
asp.net mssql I have a need to update records where the record column needs modifing in orde to match the Id value