Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change field name in SQL Select
Message
 
To
20/12/2012 06:46:22
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01560255
Message ID:
01560257
Views:
62
>Month1 is a number field in a table. I want to select this field in a SQL select statement but to change the field name returned with a corresponding date from an array of dates. I know that I have to convert the date into a character string so it can be used as a valid column returned by the SQL statement.
>
>Example Select code, department, month1 as dtos(laMonths[1]) from file1 into cursor file2.
>
>Can this be done ?
lcFieldName = "_"+dtos(DATE())&& Field names can not start with a number

Select code, department, month1 as &lcFieldName;
 from File1;
into cursor file2
  
BROWSE NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform