>According to the VFP Help HAVING without group by has the same effect as WHERE. Therefore, for me the latter of your suggestions is better. Or dealing with the query cursor in VFP after it is selected in a separate SQL Select.
>
>Thank you.
In other words, we have different behavior in VFP and SQL Server. This works in VFP
CREATE CURSOR curTemp (cField C(30))
INSERT INTO curTemp VALUES ('Test')
SELECT cField as cNewField FROM curTemp HAVING cNewField = 'Test'
but it would not work in SQL Server.
If you want compatibility, use the real field names.
If it's not broken, fix it until it is.
My Blog