The tables allow us to record multiple visit dates for each store. What we'd like to have is a list of all the stores with the visit dates on the same row as the stores and put them into Quarter1, Quarter2, Quarter3, Quarter4 columns.
So, I'd like to get all of these into excel spreadsheet. As of right now I get results with a company's info listed multiple times for each visit that was made. Which becomes a problem as more and more visits are made. Is there a way to consolidate the company information and keep the visits?
This is my select statement, but I don't know how to get this into an excel document the way I want it. SELECT * FROM dealers , dealers_visit_lookup , dealers_visit WHERE (dealers.Dealer_ID = dealers_visit_lookup.Dealer_ID )AND (dealers_visit_lookup.Date_ID =dealers_visit.ID ) ORDER BY `dealers`.`Name` DESC";
So right now I'm getting a list like this: Dealer 1 | 3-12-08 Dealer 2 | 2-20-09 Dealer 2 | 3-02-09 Dealer 2 | 3-05-09 Dealer 3 | 3-01-09
What I'd like to get is this, but in an excel spreadsheet: Dealer 1 | 3-12-08 Dealer 2 | 2-20-09 | 3-02-09 | 3-05-09 Dealer 3 | 3-01-09
No problem Kari. Thanks for your help. Here is the dump and the next post will have the select statement I'm using, and of course the excel file contents are listed on the phpfreaks link.
FROM dealers , dealers_visit_lookup , dealers_visit
WHERE dealers.Completed_By LIKE '%jason%' AND (dealers.Dealer_ID =dealers_visit_lookup.Dealer_ID ) AND (dealers_visit_lookup.Date_ID =dealers_visit.ID ) ORDER BY `dealers`.`Dealer_BusinessName` DESC