Forum Moderators: coopster
I am trying to display a list of records in day order but no matter what I try I just can't my head around it. I can list the records in date order, but I need to display them under the relevant days. eg:
--------------------
Monday:
record 1
record 2
Tuesday
record 3
Wednesday
Thurdsday
record 4
---------------------
I am extracting relevant records for this week from the database but I am having real trouble in displaying (grouping?) them in a meaniful way.
My Sql which returns the relevant records is:
SELECT CompanyName, ContactTitle, ContactFirstName, ContactSurname, ContactTel, DAYOFWEEK(ChaseDate) AS DayNumber, ChaseDate
FROM clients
where ChaseDate
>= date_add(CURRENT_DATE, interval 1-DAYOFWEEK(CURRENT_DATE) day)
and ChaseDate
< date_add(CURRENT_DATE, interval 8-DAYOFWEEK(CURRENT_DATE) day)
AND CompanyShow='1'
ORDER BY ChaseDate, CompanyName
Any pointers on what I can do?
Thanks