General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only