>Several of the fields in my database have dates associated with them- (I know it was a terrible idea to begin with) but the field is called eg. data06, data07,data08. When a new year rolls around, the operator needs to physically change the name of the oldest field: data06 to data09.
>
>Is there anyway to do this programmatically. IE is there a way to have VFP modify an actual field name using code.
>
>thanks for any suggestions - (that don't involve me re-engineering database structure that date back 12 years.)
>
>k
Do you really want to RENAME the field, or rather delete the oldest field and add a new one? The difference is, if you rename the field, you will keep the data from 2006 in your example.
To delete a column, and add another one (this will delete the 2006 data):
alter table ... drop column data06
alter table ... add column data09 Y
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)