Subject Re: Total on in dbase 8.0
From Rouke <moc.liamg@rekkabrg>
Date Thu, 08 Oct 2020 04:59:30 -0400
Newsgroups dbase.getting-started

Mervyn Bick Wrote:

>
> Firstly NEVER index on trimmed values unless you also make sure to pad
> the entire expression so that it is the same length for each record.
> All index values MUST be the same length.
>

Thanks for pointing that out. I have removed the trims an got this:

TYPETOTA                 NUMBERS RECEIVED   TESTTYPE
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /
         0         0         0.0000            /  /

However, I used:

alter table "laplmodl.dbf" add numbers numeric, add typetota character

this resulted in a numeric numbers field with a width of 20 and 4 decimal places - plenty,
but a character typetota field with a width of 1 - far too few to store the year + month + testtype

When I manually modified the table to increase the width of the typetota field to 10, the 'total on' command worked as expected.

I have looked in the dbase help for 'alter table', but at first couldn't find how to specify field width or decimals. But it say in the last line of the associated example for the 'alter table' command.

Thanks

Rouke