>Hello
>If the result of a SQL-SELECT query in VFP DBF has duplicate field names, Visual Foxpro adds "_A" to the first duplicate field and "_B" to the second.
>
>If the query is run in SQL server via Sqlexec, the first field returns with the name unchanged, and the second with a "1" appended.
>
>Is there any way to control this, that is, to get the same behavior? I have tons of reports that expect "_A" in field names.
>
>Thanks!
Explicitly name your fields. ie:
select * from customer inner join orders on customer.cust_id = orders.cust_id
would name cust_id as cust_id_a and cust_id_b.
select cs.cust_id as 'cust_id_1', o.cust_id as 'custID' ;
from customer cs ;
inner join orders o ;
on customer.cust_id = orders.cust_id
Explicitly names fields to cust_id_1 and CustID and works with both VFP and SQL server.
Cetin