Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need advice on a tricky query
Message
De
25/09/2006 13:47:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Need advice on a tricky query
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01157006
Message ID:
01157006
Vues:
67
Greetings,

To integrate with our UPS system requires using ODBC to our VFP databases and specifying the query required to pull sales order and customer data to populate the shipping address.

The "simple" query that works looks like this...

SELECT somast.sono, somast.orddate, arcust.company, arcust.contact, arcust.address1, arcust.address2, arcust.city, arcust.state, arcust.zip, arcust.phone from arcust, somast where arcust.custno = somast.custno and sono = ?vp_sono


Now here comes the rub... When the somast record contains an "X" in the field "tosw", the customer address is pulled from an entirely different table, soaddr, instead of the arcust table. All the fields in the other table are the same except that the soaddr table also contains the sono so each sales order can have a different shipping address. I'm just not sure how to get a single query (as required by the UPS system through ODBC) that will return the correct address depending on the "X" (or no "X") in the "tosw" field in somast.

Any suggestions?

Greg
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform