|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Having difficulty with CoalesceHi
Simplified version of query: Have tried both with and without SET CONCAT NULL_YIELDS_NULL ON But my database default is set to ON anyway. SELECT Address1 + ' ' + Address2 + COALESCE(', ' + Address3, '') + ', ' + Town + COALESCE(', ' + County, '') + ', ' + Postcode AS Address From Table I'm only new to the COALESCE function, but when say Address3 is NULL, then nothing from Address 3 onwards is returned into Address. What am I missing? Thanks Matt Figured it out
It was the Non-COALESCE'd columns that I didn't realise also contained nulls that was causing the problem. Cheers Matt Thanks for following up your own post. It prevents others from wasting their
time trying to help you after you have solved the problem, and it helps others when you share your solution. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Matty J" <mattyjen***@gmail.com> wrote in message news:1155229562.756836.229060@m73g2000cwd.googlegroups.com... > Figured it out > > It was the Non-COALESCE'd columns that I didn't realise also contained > nulls that was causing the problem. > > Cheers > Matt > |
|||||||||||||||||||||||