I'm using the VFP 6.0 command line to interrogate some free tables.
There is a field called MON defined as a numeric (width 4, decimal 1) which I've been attempting to export to Access.
There are issues with a straightforward pull via the VFP OBDC driver so I've been attempting to get around it by casting the field using the str function. When I run the following query from the command window:
select mon, str(mon,4,1) as mon1 from employeetime where mon = 12.0
VFP returns "1" in the query results for all mon1 fields.
for
select mon, str(mon,5,1) as mon1 from employeetime where mon = 12.0
VFP returns "" in the query results for all mon1 fields.
When I use ? in the command line like
? str(12.0,4,1)
VFP returns "12.0" (Which is what I would expect)
Why isn't VFP returning consistent results? 4 as a width should be plenty as "12.0" contains 4 characters. 5 as a width should return " 12.0" and it does with the ? but not in the query. Thanks in advance for any help
There is a field called MON defined as a numeric (width 4, decimal 1) which I've been attempting to export to Access.
There are issues with a straightforward pull via the VFP OBDC driver so I've been attempting to get around it by casting the field using the str function. When I run the following query from the command window:
select mon, str(mon,4,1) as mon1 from employeetime where mon = 12.0
VFP returns "1" in the query results for all mon1 fields.
for
select mon, str(mon,5,1) as mon1 from employeetime where mon = 12.0
VFP returns "" in the query results for all mon1 fields.
When I use ? in the command line like
? str(12.0,4,1)
VFP returns "12.0" (Which is what I would expect)
Why isn't VFP returning consistent results? 4 as a width should be plenty as "12.0" contains 4 characters. 5 as a width should return " 12.0" and it does with the ? but not in the query. Thanks in advance for any help