Apr 14, 2003 #1 James1981 Programmer Joined Nov 2, 2002 Messages 76 Location 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 Joined Apr 11, 2001 Messages 1,087 Location 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 Joined Nov 16, 2002 Messages 9 Location 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>