NULL Values in concatonation select

macleanb

Well-known Member
Joined
Dec 10, 2004
Messages
715
Hi

I am trying to select two columns (Text) liek so:

Select TB_ID + '|' + TB_Ref from MyTable


I was expecting to get either:

"|ABC"
A123|"
or
"A123|ABC"

However I only seem to get the last version, all rows where either ID or REF are null fail to calculate the concatonated string - any advice or alternative strategies to achieve this?


Many Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I don't know if it will make a difference but try replacing + with &.

If that's no use tou might want to take a look at the Nz function.

By the way is there any criteria or grouping in the query. That might affect t hings.
 
Upvote 0
P.s. I have a long standing curiosity about your sig - whats the Peruvian connection (or shouldnt I ask)
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,419
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top