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
Will there be a 13" Macbook with an iCore processor anytime soon? Safe to buy C2D?
Ghost Multicasting/IGMP
WinForms in VS 2010
Visio Stencil showing switch ports
Help needed with iphone Configuration Utility, SSL certificates ,& SBS 2003
Save only sends e-mail with removed attachment again
auto run lightbox
How do I configure OWA internal/external URL's?
mozilla keeps session even if close it
Using VBA to read inbox of non-default mailbox