I have the following table:
Item Ordqty Total_Costprice TotalSaleprice onhand Markup
ENG-MAN-0102 3852 203.34 2494 73.992
SPG-P-018 2716 1232.80 473.2232
A8 8.62 9.335 0.71
A136 1621 148.35 518 0.3777
LA 1228 7.68 14.897 7.217
ENG-DOR 1039 34.94 50.8166 15.8766
A13-00-S 968 153.64 107 0.9997
Code is
SELECT
total_costprice,
markup,
CASE WHEN markup=0 THEN 0 ELSE 100*(markup)/costprice AS pctmarkup`
This gives a divide by zero error. I need to show the percentage markup for the markup values.