I have a procedure calling some data from a view which has the where clause to Eliminates zero values, but I still get Devide by zero error. also, can anyone provide a better syntaxt to eliminate those zero's in one query?
code attached. I would basically like extracked a list of Items where the usage for this period have doubled what the last 2 months were and M1 is more than half of what we have.
select * from vw_spike_usages2
group by item_id ,qty_free,M3,M2,M1
having M1/M2+M3>=1 and M1/qty_free >=.5