Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating Problem

Status
Not open for further replies.

James1981

Programmer
Nov 2, 2002
76
US
Hi I'm trying to concatentate two varchar fields together in a query but it returns null always. Below is the code:

Code:
SELECT source + ' (' + card_digits + ')' AS reference FROM myTable

Any ideas?

Thanks, James
 
Hi,

Try one of these

SET CONCAT_NULL_YIELDS_NULL OFF

SELECT source + ' (' + card_digits + ')' AS reference FROM myTable

OR

SELECT ISNULL(source,'') + ' (' + ISNULL(card_digits,'') + ')' AS reference FROM myTable


Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top