Page 1 of 1

Concatenation

Posted: Thu Aug 13, 2009 5:03 am
by cherry
Hi All,

I have two fields to concatenate

A=(011)7171361
B=(o)

C=A:B

When I do Concatenation of A:B iam getting the value as C=A(B value is not concatenated)

But when I do C=B:A this is working fine.

Do some one has clue why this is not working for C=A+B

Iam writing the data to a DataSet

Regards
Cherry

Re: Concatenation

Posted: Thu Aug 13, 2009 5:54 am
by algfr
cherry wrote:Hi All,

I have two fields to concatenate

A=(011)7171361
B=(o)

C=A:B

When I do Concatenation of A:B iam getting the value as C=A(B value is not concatenated)

But when I do C=B:A this is working fine.

Do some one has clue why this is not working for C=A+B

Iam writing the data to a DataSet

Regards
Cherry
Hi Cherry

You have to make sure that B is not null (seems to be the case for you).

So I suggest you do this :

If isNull(A) Then '' Else 'A' : If isNull(B) Then '' Else 'B'

Please update if that works

Arnaud

Posted: Thu Aug 13, 2009 7:26 am
by chulett
Was wondering about that, but if one was null neither 'direction' would work. :?

Posted: Thu Aug 13, 2009 7:39 am
by Sainath.Srinivasan
Are they char or varchar ? What are their lengths ?

Make all varchar and do a trim on A and B.