I have a query, where i'm pulling invoice data for some exceptions. We've noticed some theft when a specific service type is tendered.:
Select Username, Service, Time, invoice#
From Invoice_Tb
Where Service_Category = 'Service_Type1'
Output:
Username Service Time Invoice#
Bob Service1 3/1/17 4:30AM 1234
Bobby Service2 3/1/17 5:30AM 1633
Jim Service2 3/7/17 5:45AM 1894
What I'd like to do is grab some additional information from "Invoice_Detail" table, based on the results from my first query. We've found auditing all of the records, is quite arduous. So, i'd like to see what additional services were on these invoices.
Example of the output i'm looking for:
Username Service Time Invoice# Other_Services
Bob Service1 3/1/17 4:30AM 1234 Service1, sv7, sv8
Bobby Service2 3/1/17 5:30AM 1633 Service2, sv9, sv5
Jim Service2 3/7/17 5:45AM 1894 Service2, sv7, sv9
Keep in mind, the Invoice_Detail_Tb lists the details on separate line items - always listing the same invoice#.