|  | Posted by Rico on 06/12/94 11:45 
Thanks Guys,
 I wound up finding ISNULL before I had a chance to post back. (why do I
 always find the solution right after I post).
 
 Is there an argument for using Coalesce over IsNull?
 
 Thanks!
 
 
 
 "Hugo Kornelis" <hugo@perFact.REMOVETHIS.info.INVALID> wrote in message
 news:j7sf42hg4b78p8u1v5nj283av4kovqivur@4ax.com...
 > On Thu, 20 Apr 2006 20:25:47 GMT, "Rico" <r c o l l e n s @ h e m m i n
 > g w a y . c o mREMOVE THIS PART IN CAPS> wrote:
 >
 >>I'm moving some queries out of an Access front end and creating views out
 >>of
 >>them in SQL Server 2005 express.  In some of the numeric fields, I use nz
 >>quite often, ( i.e. nz([MyField],0)) to return a zero if the field is
 >>null.
 >>Is there anything equivalent to this in SQL Server?  Right now I'm using
 >>CASE WHEN ... but it seems like an awful lot of script to write just to
 >>replace null with a zero.
 >>
 >>Any help would be greatly appreciated.
 >>
 >>Thanks!
 >>
 >
 > Hi Rico,
 >
 > Use COALESCE:
 >
 > COALESCE (arg1, arg2, arg3, arg4, ...)
 >
 > returns the first non-NULL of the supplied arguments. You need at least
 > two arguments, but you can add as many as you like.
 >
 > --
 > Hugo Kornelis, SQL Server MVP
  Navigation: [Reply to this message] |