Hello:
The following statement throws "SQL: Error correlating fields.":
select *; from cwkt; where; funccode="TW" and trndate>={^2017.07.01} and; exists; (; select .t. from ctwc; where; cwkt.clcode=ctwc.clcode and cwkt.wccode=ctwc.wccode and; cwkt.trndate between ctwc.validfr and ctwc.validto; ); order by clcode,wonbr,trndate
This statement works:
select *; from cwkt; where; funccode="TW" and trndate>={^2017.07.01} and; exists; (; select .t. from ctwc; where; cwkt.clcode=ctwc.clcode and cwkt.wccode=ctwc.wccode and; cwkt.trndate>=ctwc.validfr and cwkt.trndate<=ctwc.validto; ); order by clcode,wonbr,trndate
The only difference is the second line of the nested select's where expression. The first uses between, and the second uses >= and <=.
What am I missing?
Sincerely,
Gene Wirchenko