Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advice on a tricky query
Message
From
25/09/2006 13:47:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Need advice on a tricky query
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01157006
Message ID:
01157006
Views:
66
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
Next
Reply
Map
View

Click here to load this message in the networking platform