Backend: SQL Server 2000
Crystal Version: XI
I have a total of 10 columns that I'm trying to concatenate; however, whether or not I concatenate 2, 4, 6, 8, or all 10 columns would depend if the source column is null.
For example: My data consists of the following tables and columns:
{Part.Dim1} - source lookup
{Part.Dim2} - source lookup
{Part.Dim3} - source lookup
{Part.Dim4} - source lookup
{Part.Dim5} - source lookup
{Category.Var1}
{Category.Var1}
{Category.Var1}
{Category.Var1}
{Category.Var1}
I want to concatenate Dim1 with Var1 and then all 5 groupings (Dim2 with Var2; Dim3 with Var3, etc) only if the originating Dim column(s) is/are not null.
For example: If non of the Dim columns were null for a part then I would just do:
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim2} & " " & {Category.Var2} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4} & " " & {Part.Dim5} & " " & {Category.Var5}
If Dim2 is null then I could concatenate all except Dim2 and Var2 like:
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4} & " " & {Part.Dim5} & " " & {Category.Var5}
If Dim2 and Dim5 were null then I would not include Dim2, Var2, Dim5, and Var5 with the concatenation like
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4}
How would I write an If Then Else statement that would handle this?
Crystal Version: XI
I have a total of 10 columns that I'm trying to concatenate; however, whether or not I concatenate 2, 4, 6, 8, or all 10 columns would depend if the source column is null.
For example: My data consists of the following tables and columns:
{Part.Dim1} - source lookup
{Part.Dim2} - source lookup
{Part.Dim3} - source lookup
{Part.Dim4} - source lookup
{Part.Dim5} - source lookup
{Category.Var1}
{Category.Var1}
{Category.Var1}
{Category.Var1}
{Category.Var1}
I want to concatenate Dim1 with Var1 and then all 5 groupings (Dim2 with Var2; Dim3 with Var3, etc) only if the originating Dim column(s) is/are not null.
For example: If non of the Dim columns were null for a part then I would just do:
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim2} & " " & {Category.Var2} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4} & " " & {Part.Dim5} & " " & {Category.Var5}
If Dim2 is null then I could concatenate all except Dim2 and Var2 like:
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4} & " " & {Part.Dim5} & " " & {Category.Var5}
If Dim2 and Dim5 were null then I would not include Dim2, Var2, Dim5, and Var5 with the concatenation like
{Part.Dim1} & " " & {Category.Var1} & " " & {Part.Dim3} & " " & {Category.Var3} & " " & {Part.Dim4} & " " & {Category.Var4}
How would I write an If Then Else statement that would handle this?