November 6, 2015 at 5:33 pm
Derrick Leggett (6/22/2004)
Don't divide by zero. <img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'> You need to figure out where you are doing this and fix it.
BWAAA-HAAA!!!! Even if this thread is more than a decade old, I saw the title of this thread and I knew what my answer would be. You beat me too it and I had a great laugh after a tough day. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
November 6, 2015 at 5:36 pm
nigel. (2/26/2010)
Guys you're posting answers to a question asked in 2004. I hope they've fixed the problem by now. :w00t:
It's now more than a decade and if they're anything like the people I've been interviewing lately, the I'd have to say "probably not". 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
November 6, 2015 at 5:37 pm
Luis Cazares (11/6/2015)
priterande (11/5/2015)
select COALESCE(MIN(Act) / NULLIF(MAX(Act),0), 0) as minvsmaxAct from table_nameThis is what I usually do, except that I don't reply to 5 year old threads. :w00t:
I usually don't care when a thread started... especially if someone has a better idea.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 8, 2015 at 9:58 pm
You can also do this
SELECT Dividend / ISNULL(NULLIF(Divisor,0),1) AS Result
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply