Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where clause genereates C5 Error
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00800345
Message ID:
00800359
Views:
20
Hi Leroy,

When you are using AND & OR clause both, then you should put the proper parenthesis to saggregate the two expressions.
What i understand from second paragraph is that you want to fulfill either first 7 conditions or only the 8th condition.
Then please use
***********************
WHERE (Shipping_and_receiving_tickets.company = ?vp_company ;
AND Shipping_and_receiving_tickets.crop_year = ?vp_cropyear ;
AND Shipping_and_receiving_tickets.commodity = ?vp_commodity ;
AND Shipping_and_receiving_tickets.class = ?vp_class ;
AND TTOD(Shipping_and_receiving_tickets.ship_date) = ?vp_date ;
AND SUBSTR(Warehouse.pool, 4, 2) = ?vp_pool ;
AND Shipping_and_receiving_tickets.from_whs = ?vp_warehouse) ;
OR (Shipping_and_receiving_tickets.to_whs = ?vp_warehouse)
***********************

Or, please let us know that which all conditions you want to evaluate.


---
Raj
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform