I get an Ambiguous column name error with this query (InvoiceID). I can\'t figure out why. They all seem to be joined correctly so why doesn\'t the management studio know to
Because you are joining two tables Invoices and InvoiceLineItems that both contain InvoiceID. change to Invoices.InvoiceID to make it correct.