Subject Re: indexing with character numbers
From Mervyn Bick <invalid@invalid.invalid>
Date Sun, 26 Jan 2025 10:23:04 +0200
Newsgroups dbase.getting-started

On 2025/01/26 07:00, Ken Mayer wrote:


> As Mervyn notes, you have to manipulate it the data. It would be simpler
> to use a numeric field. Then you don't have to do anything special.
>
> Importing from Spreadsheets will attempt to make sense of the data, so
> if you import a numeric column, it should come in as numeric.
>
> Ken
>

If it works it's not wrong but there are often better alternatives.

My previous post was written late at night and the old grey cells were
already half asleep.  I assumed that Charlie already has a routine for
importing the values as left-justified strings and I didn't want to open
that can of worms.  If he can change that so that the values are
imported as numeric values then an index on the numeric field does the job.

In the cold light of day the old grey cells are a bit more active and
there is a simpler solution to the one I posted before which also
doesn't require any changes to the import routine.

    index on val(charfld) tag tagname

Mervyn.