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
Mac Mini with Blu-Ray
Adding local storage to ESX 3.5
Hyper v full Installation remote administration issues
Can Windows Server Standard 2008 FE be upgraded to Standard level without breaking Exchange 2007 SP1 currently installed?
How to retrieve data from an XML file using ASP.NET?
Router disconnect when 2 pcs are connected
SUSE Linux - Detect new disk (hardware)
Link to PDF files from DVD Menu
Cisco Switch not configured with TACACS asks for username?
Resize multi select boxes in SharePoint form