Came across this at work today when a sum was returning null, it was presumed zero would be so there wasn't a check in place.
My first thought was to use NZ but that's Access not SQL-Server, there is IsNull() but COALESCE() was used in the end.
I'd never come across this so thought I'd share.
COALESCE() Returns the first nonnull expression among its arguments. COALESCE ( expression [ ,...n ] ) Returns the data type of expression with the highest data type precedence. If all expressions are nonnullable, the result is typed as nonnullable.
Reply from Richard Rost:
Interesting. Never had a need for that function before. Thanks for sharing.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.