ims_lenor
23rd June 2004, 16:55
Hello

I need to do a select for the first 4 digits of index1

i tried it like this:

select table001.*
from table001
where table001._index1(1;4) = "asdf"
selectdo
selectempty
endselect

and also like this:

select table001.*
from table001
where table001.field(1;4) = "asdf"
selectdo
selectempty
endselect

do you have any solutions for me?

kbartelds
23rd June 2004, 17:55
Try:

where table001.field like "asdf.*"

Regards,
Klaas

ims_lenor
23rd June 2004, 18:06
Try:

where table001.field like "asdf.*"

Regards,
Klaas
thx that works! but when i want to replace "asdf" with a variable it doesnt... doesnt matter if I try it with {:temp} :temp

you know something about?

ulrich.fuchs
23rd June 2004, 19:24
I would use the inrange statement, since the like statement tends to be slow:

...where tiitm001._index1 inrange {"asdf "} and {"asdfZZZZZZZ"}

Uli

mark_h
23rd June 2004, 20:25
You could do this using dynamic sql. Search the tools forum for posts on this topic. That forum would be better for topics like this.

Good Luck!

Mark