Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Correlating Fields(BUG)
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00704024
Message ID:
00704319
Views:
17
Your select seems to be too complicated. Yesterday I though about re-writing it this way (not sure, it would work either):
SELECT Order.* from order inner join Dly_Emp on VAL(order.emp_no)= dly_emp.emp_no where dly_emp.tTimeIn < Order.TInit and ...
>Whenever I explain a bug, I simplify the symptoms as much as possible. I don't actually want ".or. .T.", literally, as I already explained below-- I was actually testing on another dly_emp field before I found that this bug reared its ugly head, even with a simply ".or. .T.". Therefore, your work-around really doesn't help. Thanks anyways.
>
>
>>VFP has a limited support for subqueries and very limited support for correlated subqueries. The workaround in your case would be to use
SELECT * from order WHERE VAL(order.emp_no) In ;
>>  (SELECT dly_emp.emp_no FROM dly_emp)
because subquery would return all records anyway with 'OR .T.' added to the where clause.
>>If you consider this a bug, you can report it to Microsoft at http://support.microsoft.com/Support/vfoxpro/report/report.asp
>>
>>>Can anyone explain why this works:
>>>
>>>
>>>SELECT * from order WHERE VAL(order.emp_no) IN ;
>>>		(SELECT dly_emp.emp_no FROM dly_emp WHERE ;
>>>			dly_emp.tTimeIn < order.tInit )
>>>
>>>
>>>and this doesn't(Note that the ".OR. .T." is the only change)?
>>>
>>>
>>>SELECT * from order WHERE VAL(order.emp_no) IN ;
>>>		(SELECT dly_emp.emp_no FROM dly_emp WHERE ;
>>>			dly_emp.tTimeIn < order.tInit .OR. .T.)
>>>
>>>
>>>
>>>This throws error 1801: "Error correlating fields". I was obviously trying to do real comparing instead of just ".OR. .T.", but numerous tests proved that this causes these problems. A simple ".T. or .T." or ".F. or .T." doesn't, however... Ideas? Work-a-rounds to this BUG in VFP7 SP1? Any acknowledgement by Microsoft? Thanks.
>>>
>>>
>>>FYI: order.emp_no is string, dly_emp.emp_no is numeric, and tTimeIn and tInit are DateTime with some empty values in the dly_emp table.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform