|
Wild guess here, but I assume that when you say tickets.Opened_By and tickets.Closed_by point to Rep, you mean you have a code in those colums that correspond to, say, something like rep.Rep_ID. Am I close?
If so, you could try something like
SELECT open_rep.Rep_First_Name as Open_Rep_Name, close_rep.Rep_First_Name as Close_Rep_Name, ticket.Ticket_Number FROM tickets INNER JOIN rep AS open_rep ON open_rep.Rep_ID = ticket.Opened_By INNER JOIN rep AS close_rep ON close_rep.Rep_ID = ticket.Closed_By WHERE ticket.Ticket_Number = the_ticket_i_want
"rep AS open_rep" and "rep AS close_rep" give the two references to the rep table the uniqueness they need to prevent the "ambiguous reference" error you're likely to get if you don't use "AS".
Hear it got cold down your way last night.....
|