Basically what I need to do is SORT a table by Client Surname then Client Firstname which is easy enough.
However I am trying to sort records of sales and the only link to the customer is by id. For example my table is similar to:
sale_id | client_id1 | client_id2 | sale_date | sale_type | sale_net | sale_total
and 2 dummy records are
1 | 77 | NULL | 20070105 | Phone | 77.81 | 86.99
2 | 89 | 90 | 20070207 | Store | 532.05 | 599.99
And obviously the client records that refer to 77,89,90 all hold detailed information about each client including firstname, suranme etc. So how can i sort the sales (including the firstname and surname) and sort by them?