Subject Re: dataq modules - calculated fields
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 10 Jul 2020 15:59:06 +0200
Newsgroups dbase.getting-started

On 2020-07-10 15:19, Bruce Beacham wrote:

>> The following command produces an "invalid field name error":
>> select energydata.energyProducedWh from "energydata.dbf"
>
> select energydata.energyProducedWh from "energydata.dbf" energydata
> which is equivalent to Mervyn's use of
> e.

When qualifying a fieldname one can either use the actual table name or
a table correlation name (alias).  If one applies a correlation name to
a filename, dBASE is smart enough to assign the actual tablename to the
correlation name behind the scenes.

energydata.dbf is a filename, not a table name, so one needs to use a
table correlation name which, in the case above, is energydata.  I'm
usually too lazy to bother typing out tablenames so I invariably use one
or two characters as a correlation name.  It doesn't save much time when
there is only one field to be qualified but when there are many fields
in a JOIN .... :-)

Mervyn.