Homepage » Web Development » Preventing Division by Zero in SQL Calls (and Megan Fox)

Preventing Division by Zero in SQL Calls (and Megan Fox)

By Jonathan + November 17th, 2005

Okay, I know this is uber-geek so no need to mention that in the comments :D But I was searching for an easy way to prevent division by zero in a division operation in a (MS)SQL SELECT statement, and this popped out as a great way to do so. Use at your own risk of also being branded a geek, and being forced into a world of Star Trek collectables ;-)

ISNULL( NULLIF( your_field, 0 ), 1 )

6 Comments at "Preventing Division by Zero in SQL Calls (and Megan Fox)"

blog-j November 17th, 2005 (#)

Sexy Sql Tip

Monsieur Keebler has a quick little post on avoiding divide by zero errors in Sql.
Coupled with some fairly… warm and fuzzy … imagery of the foxy Megan Fox.
Have a read (and look) over @ keebler.net

Fuzzzy November 17th, 2005 (#)

I for one welcome our non-divisible-by-zero overlords :)

Jonathan November 17th, 2005 (#)

I hear when you divide by zero, God kills a kitten.

MrHappy November 17th, 2005 (#)

I heard that when you divide by zero the client kills a developer. I, however, have proof against this. You know what I’m talking about.

Jonathan November 17th, 2005 (#)

Bill for another 8 hours? :D

dasd December 12th, 2007 (#)

so beatifull

Comment Now!

Name* Email* Blog / Website

Latest Posts

Fixing Connect360 on the New Xbox Experience November 19th, 2008

Fixing Connect360 on the New Xbox Experience

When I fired up the New Xbox Experience tonight, the first thing I checked was whether Connect360 worked. I think I would probably use my Xbox for a[...] Read the rest »