var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: If Else question URGENT
I want to run a query that will insert rows into another table.
I also want to do some calculations on a couple of the columns:
Response = Orders / Mailed,
[Average Invoice] = Sales / Orders,
SMP = (Sales / Mailed) * 1000
I have a condition where some of the colums might have a 0 in them, which of course causes a "Divide by 0" error. What I would like to do is put an IF statement in the query to deal with this 0.
if orders = 0 then response=0
else response = Response = Orders / Mailed
Hope this makes sense!
Re: If Else question URGENT
Try using SQL CASE:
CASE WHEN Mailed = 0 THEN 0 ELSE Orders / Mailed END,
Thank you!!! So very much, worked like a charm!