>Dear readers,
>
>When i execute the folowing SQL query, i get the error colomn "WTG"not found.
>
>SELECT detail.avr_ari,;
> iif(Detail.avr_wtg=.t.,'J','N') as WTG;
>FROM general!detail;
>WHERE WTG='J'
>
>Is this an impossible kind of query, to include an expressionalias in the WHERE Clause ?
>
>Any idea's how to solve this ?
>
>- Bjorn
You can not include calculated expression in the same SQL statement. You can run 2 queries, or you can do:
SELECT avr_ari, "J" as WTG ;
FROM general!detail ;
WHERE avr_wtg=.t. ;
INTO cursor curWtgs
If it's not broken, fix it until it is.
My Blog