Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Integer field: How do I locate a partial integer for an incremental search?
Thu, Oct 11 2012 6:16 PMPermanent Link

Allan Roberts

Is there a way to locate a partial integer with dataset.locate?  I'm trying to do a drill-down (incremental search) against an integer field, and would like to be able to drill against partial values.  I have tried various combinations of locate, gotonearest, etc. and all fail to do this.  Thanks for any help.
Fri, Oct 12 2012 4:02 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Allan


I assume you have a "structured" integer so that 100235 would mean something like 100 = shoes and 235 = red ladies size 10.

Anyway, you're out of luck as far as locate etc are concerned since an integer is a single entity unlike a varchar. What you can do is a filter or query eg

SELECT id FROM table WHERE id > 100000 AND id < 100359 TOP 1

and then, if a result is returned use the id in a locate.

If you're trying to pick digits out of the middle you could do something like

SELECT id FROM table WHERE SUBSTR(CAST(id AS VARCHAR(6)),2,3)='xx'  TOP 1

Sorry if the syntax isn't right but its a long time since I moved from DBISAM to EDB so I'm not up on what's what these days


Roy Lambert [Team Elevate]
Sun, Oct 21 2012 11:29 AMPermanent Link

Robert Kaplan


<Allan Roberts> wrote in message
news:FF2CC885-833E-4394-BDF2-F4DC715742D3@news.elevatesoft.com...
> Is there a way to locate a partial integer with dataset.locate?  I'm
> trying to do a drill-down (incremental search) against an integer field,
> and would like to be able to drill against partial values.  I have tried
> various combinations of locate, gotonearest, etc. and all fail to do this.
> Thanks for any help.
>

I don't hink you can do it with an integer. You could select the key field
and the integer search field cast as a string into a memory table, do your
locate partial key on the memory table and then do a locate using the key
field on the main table.

Robert

Image