Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement