CONCATENATION problem!!?? (SQL 2000)
-
help anyone!! phaleezz!! i just want to combine the returned values(both varchar types)of my two 'user defined function' as one field in my sql statement my codes like this..
select cast (UDF_getCellNos + '/' + UDF_GetLandLines as varchar(100)) as Contact_Info from tblCrewInfo
if both my UDF's returns a value.. my column 'Contact_Info' returns '09179673815 / (02)9614337' works out fine.. but if either of my UDF's does not return a value... my column 'Contact_Info' returns 'null' it's supposed to return the value of the other UDF.. and thats my problem :doh: ..is there any other way i can get my UDF's returned values as one column, even if one doesn't have a return value? any help will be appreciated... thanks in advance -
help anyone!! phaleezz!! i just want to combine the returned values(both varchar types)of my two 'user defined function' as one field in my sql statement my codes like this..
select cast (UDF_getCellNos + '/' + UDF_GetLandLines as varchar(100)) as Contact_Info from tblCrewInfo
if both my UDF's returns a value.. my column 'Contact_Info' returns '09179673815 / (02)9614337' works out fine.. but if either of my UDF's does not return a value... my column 'Contact_Info' returns 'null' it's supposed to return the value of the other UDF.. and thats my problem :doh: ..is there any other way i can get my UDF's returned values as one column, even if one doesn't have a return value? any help will be appreciated... thanks in advance -
Concatenating a NULL value with a string will always return NULL. Use the
ISNULL
function to convert NULL values to empty strings to prevent this happening.Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
woahhh you're a god man thanks for a fast reply thanks pmarfleet damn i really love this site!!