Guest Posted December 22, 2004 Share Posted December 22, 2004 Is there an easy way to have the customers listed in ascending or descending order by date (account created) instead of last name (default)? Our customer base is getting a little larger and I need to start maintaining it better. Thanks in advance! Link to comment Share on other sites More sharing options...
boxtel Posted December 22, 2004 Share Posted December 22, 2004 Is there an easy way to have the customers listed in ascending or descending order by date (account created) instead of last name (default)? Our customer base is getting a little larger and I need to start maintaining it better. Thanks in advance! <{POST_SNAPBACK}> change the query in customers.php $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname"; Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted December 22, 2004 Share Posted December 22, 2004 Thank you for the reply Amanda. I have tried but can not seem to figure it out completely. What should I do with the info provided? I'm kind of new at PHP. Thanks! Link to comment Share on other sites More sharing options...
boxtel Posted December 22, 2004 Share Posted December 22, 2004 Thank you for the reply Amanda.I have tried but can not seem to figure it out completely. What should I do with the info provided? I'm kind of new at PHP. Thanks! <{POST_SNAPBACK}> the query fetches all customers sorted on lastname and first name. after this query another is done to get the account create date etc. that info is in the customers_info table. so if you want the list to be sorted on account create date, you need to combine the 2 queries in a table join and sort it on the create date. Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted December 23, 2004 Share Posted December 23, 2004 the query fetches all customers sorted on lastname and first name.after this query another is done to get the account create date etc. that info is in the customers_info table. so if you want the list to be sorted on account create date, you need to combine the 2 queries in a table join and sort it on the create date. <{POST_SNAPBACK}> Thanks again, Amanda. I had a chance again to look at the code in question and realized an easier solution... just changed order by c.customers_lastname, c.customers_firstname"; to order by c.customers_id"; and voila... all sorted by customer id # which is just as good as sorting by date. I'm such a goof! :blush: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.