ELIMINATE DIVIDE BY ZERO

By Jason S
Access over 40 UI widgets with everything from interactive menus to rich charts.

To Eliminate the divide by zero error in a calculation in SQL 2005.

To Eliminate the divide by zero error in a calculation in SQL 2005 use the following:

DECLARE @a money, @b int
SELECT @a=1, @b=0
SELECT     ISNULL(@a/NULLIF(@b,0),0)
Popularity  (1660 Views)