Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining multiple tables.
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00257176
Message ID:
00257311
Views:
24
Seriously, no personal offense, but I have never gotton anywhere trying to implement a cyclical relationship in a single query. If it doesn't bomb, it usually narrows the result set to nothing. I am really curious as to how your suggestion worked.


>(chuckling)
>
>Gee, Erik, *really* appreciate all the confidence (g,d&r)
>
>Evan
>
>
>>>>Hi Ken,
>>>>
>>>>Without knowing the fields you want, or the names of the detail tables, here's my best guess at what you're looking for:
>>>>
>>>>-- code snip follows --
>>>>
>>>>SELECT ALL ;
>>>> SoMaster.Field1, ;
>>>> SoMaster.Field2, ;
>>>> SoDetail1.Field1, ;
>>>> SoDetail1.Field2, ;
>>>> SoDetail2.Field1, ;
>>>> SoDetail2.Field2, ;
>>>> ;
>>>>FROM SoDetail2, SODetail1, SoMaster ;
>>>>WHERE SoDetail2.ItemNo = SoDetail1.ItemNo ;
>>>>AND SoDetail1.SoNumber = SoMaster.SoNumber
>>>>
>>>>-- end code snip --
>>>>
>>>>You don't need to link the two detail tables together, since you're already linking the master to the first detail table and there's a common link between the two detail tables.
>>>>
>>>>Evan Pauley
>>>>
>>>>
>>>>Ken Morehouse wrote:
>>>>>Hello all,
>>>>>This is probably a question that has been asked numerous times, but I have an urgency.
>>>>>
>>>>>Scenario:
>>>>>1 Sales Order Master Table and 2 detail tables
>>>>>I need to select all SO's for a given customer from the master.(This is no problem). Next I need to select the item detail from 2 separate tables. the 2 detail tables need to link to the master by SOnumber, and to each other by SOnumber and ItemNumber.
>>>>>
>>>>>Any ideas? I'm racking my brain on this one. I have fallen on the wayside from coding anymore, but need to get this project out for the sales dept ASAP. ANY HELP WILL BE GREATLY APPRECIATED!!
>>>>>
>>>>>Thanks in advance,
>>>>>Ken Morehouse, MCP
>>>
>>>
>>>THANKS A MILLION!!! That was what I needed.
>>
>>That worked??
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform