June 7, 2008 at 3:42 am
Hi Folks,
I have sql query, in that i am using the alias name for the 3 columns.
select column1 + column2 + column3 as column from table. for some of the rows having the null values for the column3. when the value of the column3 is null then the total row string is coming as null.
If the column3 value is null then i should get the column1 + column2 value as column. how to resolve this problem, please lemme know.
thanks in advance.
June 7, 2008 at 7:29 am
I think you could use isNull function to give you an empty string when any column is null as follows:
select isNull(c1, "") + isNull(c2, "") + isNull(c3, "") as Combined from table .....
June 7, 2008 at 7:43 am
sorry, you should have a single quote as follows:
select isNull(c1, '') + isNull(c2, '') + isNull(c3, '') as Combined from table .....
June 8, 2008 at 9:46 pm
Thanks folks...... it has helped me...
June 10, 2008 at 8:13 am
There is a database setting under options called "Concat_Null_Yeilds_Null"...turn this setting off to resolve your problem.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply