Apr 14, 2003 #1 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 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
Apr 14, 2003 #2 sunila7 Technical User Apr 11, 2001 1,087 US 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 Upvote 0 Downvote
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
Apr 14, 2003 #3 KraGiE Programmer Nov 16, 2002 9 US SELECT [Reference] = (Source + ' ' + Source2) From Table Where... .NET Developer/Contracting Consultant. <a href="http://www.inklass.com">InKlaSs.com</a> Upvote 0 Downvote
SELECT [Reference] = (Source + ' ' + Source2) From Table Where... .NET Developer/Contracting Consultant. <a href="http://www.inklass.com">InKlaSs.com</a>