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
Title:
Where clause genereates C5 Error
Miscellaneous
Thread ID:
00800345
Message ID:
00800345
Views:
53
Hello all! I am trying to create a view that has an 'OR' in it and it keeps giving me a C5 Error
ok. When I make the where clause like this It is fine but it is not what I want:
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)
That however is not what I want What I want is
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)
This code when I try to save it gives me a C5 error. I was tring to create this in eView and also in viewEdit25 from GeeksandGurus.

I don't think that I can do this in the View Designer so I really need some help.

So I guess the real question is How can I get the second where clause to create without crashing VFP

Thanks in advance
What is Wisdom?
Wisdom - The ability to respond to any situation according to God's Plan.
Therefore:
USE Wisdom IN Everything ORDER priority AS Knowledge
SELECT Knowledge
BROWSE FOR Understanding WHERE Wisdom=Guide

LeRoy Jackson
Next
Reply
Map
View

Click here to load this message in the networking platform