EXCELLENT... Thank you very much Matt. Very Much Appreciated! On 6/16/05, Matthew Walker <[EMAIL PROTECTED]> wrote: > Should work in PostgreSQL and MS SQL... > > CASE > WHEN (Indx.Net_Exp_Starts > 0) > THEN (Indx.Inv/Indx.Net_Exp_Starts) > ELSE 0 > END AS Yield > > -----Original Message----- > From: Gonzo Rock [mailto:[EMAIL PROTECTED] > Sent: Friday, 17 June 2005 12:15 p.m. > To: CF-Talk > Subject: A Test for Division by Zero a SQL Query... > > Select (Indx.Inv/Indx.Net_Exp_Starts) AS Yield from Indx Blows up when > Net_Exp_Starts = 0 with a Division by Zero SQL Error in postgreSQL > and MSSQL. > > Does anyone know how can I return 0 as the yield when the divisor is 0? > > Thanks soooo much, > Gonz > > > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209882 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54