I have been trying to access a dbf file. Complete an analysis and export it into a results.dbf.
This is what I am trying
CLEAR
USE SourceTable.dbf
CREATE TABLE OutputTable.dbf (col1 int, col2 numeric(5,2))
SELECT SourceTable.dbf
**analysis which is calculating life expectancy**
SCAN
col1 = col1 + 1
col2 = 1 / (1 - sourcetable.colB)
APPEND BLANK
REPLACE col1 WITH col1, col2 WITH col2
ENDSCAN
USE
CLOSE ALL
It keeps stating that I am not defining col2 but I am above
I am looking for an output file with col1 int, col2 numeric(5,2)
Vfp/FoxPro assumes that any "name" like for instance
col2is a column in the first place. If in your example there is another namecol2which is not an (alias.)column but rather a variable, then (why not choose a different name) and you'd want to use the alias names prefixes for the table.column names and them.prefix for the memvars, *and also preferably use the 'In' clauses with all xBase commands / functions that have one, especially when there are two different source&destination aliases/work-areas involved in your case, or even better use Vfp's SQL Insert Into command e.g.NB: the sample code you posted would not run because of syntax errors, e.g.: