Simple Query Help -- but I am missing it

  • Hello All,

    I need help to create  a simple query :

      Tables are as follows

           Table Name                  Keys 

           tblResv           kResNum    PK

           tblInvoiceHdr   kResum      FK

           tblInvoiceDtl   kResNum     FK

    I need to create a query which

        will return all records in tblResv and their associated  Invoice and Invoice Dtl

     Even if a record in tblResv has no records I want it returned.

    If there are invoice records then link all 3 tables

    Do I need an LEFT INNER Join on    tblREsv and tblInvoiceHdr and a

    Inner Join on tblInvoiceHdr and  tblInvoiceDtl

    Thanks for your help

    Yorgs

     

     

     

     

  • a left outer join would select all records from tblResv.... but there really is not enough info from the table description provided to give you the SQL.... I am lazy and build all my SQL from the query builder it's easy and you can keep changing the SQL quickly to make sure you have the sort of results needed.

  • also you should be pitching this question in the T-SQL forum area

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply