I'm constructing a single string of several counts with concatenated labels using SQL and want to not show zeros (or their labels). Is there a function within an SQL statement that will let me do this? ISNULL() sort of does this, but I really need to test for zero instead of NULL to eliminate noise data from the string.You could write your own User Defined Function. Check out Books On Line for more info.
|||
Try the links below you may find T-SQL funtion to do what you need, but remember ISNULL can give just plain wrong numbers with OUTER JOIN in SQL Server, it is a known issue. Hope this helps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_nos-nz_3uhy.asp
http://www.samspublishing.com/articles/article.asp?p=31283&seqNum=3&rl=1
No comments:
Post a Comment