hkrisz79
2nd February 2007, 14:10
Hi All!

I have a problem with an SQL statement in a session script.

I want to select tdzus040.knvs and tdzus040.fixd

where tdzus040.ornr = tdsls040.refa

tdzus040.ornr and tdsls040.refa has a different type:

.ornr - str
.refa - mbst

the length is same - 30

How can I make the right maches? Have I use some type conversion?



Please, somebody help me!

Thanks in advance!

Krisztián

bdittmar
2nd February 2007, 14:19
Hi All!

I have a problem with an SQL statement in a session script.

I want to select tdzus040.knvs and tdzus040.fixd

where tdzus040.ornr = tdsls040.refa

tdzus040.ornr and tdsls040.refa has a different type:

.ornr - str
.refa - mbst

the length is same - 30

How can I make the right maches? Have I use some type conversion?



Please, somebody help me!

Thanks in advance!

Krisztián

Hello,

maybe the problem is the orientation of the fields.
If one is orientated left, and the other right, no match.
tdsls040.refa is from domain tcrefa MB(30) Allignment = NOT

Maybe a strip$(field) will help.

Debug and trace your source to analyse.

Regards

hkrisz79
2nd February 2007, 15:03
Hi Bernd,

I checked the table defenition and the result:
tdzus040.ornr - domain: tc.refa aligment : No

So, it should not be the reason.... :(

Any idea?

Regards

Krisztián

bdittmar
3rd February 2007, 16:04
Hi Bernd,

I checked the table defenition and the result:
tdzus040.ornr - domain: tc.refa aligment : No

So, it should not be the reason.... :(

Any idea?

Regards

Krisztián

Hello,

where field = :condition


maybe there are leading or trailing spaces.

You can try shiftl$(strip$(FIELD))

Regards

hkrisz79
5th February 2007, 10:37
Hi!

Yeah! It's working at last!

It's solve the problem:

refa.f = shiftl$(strip$(tdsls040.refa))
refa.t = refa.f & "ZZZZZZZZZZZZZZZZZZZZ"
select tdzus040.fixd, tdzus040.knvs, tdzus040.ornr
from tdzus040
where tdzus040.ornr between :refa.f and :refa.t
order by tdzus040.ornr


Thousands of THX!

Regards

Krisztián