Hi everyone,
I am relatively new to SQL and am taking over for a developer and need a little assistance.
There are a couple of db fields and I need to ORDER the search results. There is a single field called "times" that stores dates and times for an event in this format - "08/13/2012%%9:00 am-1:00 pm&&08/16/2012%%9:00 am-1:00 pm". Then there is another field that simply stores the two-letter abbreviation for a US state. I need the SQL query to return all records in the table ordered by the first date and then by state.
I tried the following with no luck.
SELECT * FROM camps ORDER BY SUBSTRING_INDEX(times, '%%', 1), state
This still does not order by the first date in the field and then by state.
Any thoughts would be greatly appreciated.
Thanks!