Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expression sql column not found
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01364005
Message ID:
01364006
Views:
19
Move it into HAVING clause
 WHERE ... 
 HAVING sugamt > 0 ;
 ORDER BY ...
>I am trying to retreive all values that return a non-zero from a expression column, but I'm getting syntax error saying:
>
>
>SQL:  Column 'SUGAMT' is not found.
>
>
>here is my query:
>
>
>SELECT Products.p_productname, Products.p_itemcode,;
>  Products.p_unitsinstock, Products.p_unitsonorder,;
>  Products.p_totqtyperunit, Products.p_qtyperunit, Products.p_max,;
>  Products.p_min,;
>  IIF(Products.p_unitsinstock<=Products.p_min,Products.p_max-Products.p_min,0000000) as sugamt;				  
> FROM ;
>     warehouse!products;
> WHERE  Products.p_itemcode BETWEEN ?lc_bitem AND ?lc_eitem AND Products.p_listactive = .T. and sugamt > 0;
> order BY Products.p_productname INTO CURSOR prodrep
>
>
>I only want to retrieve values that have sugamt greater than 0. Is a derived column not allow in the where column?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform