When adding the line:
LEFT JOIN core_records_sales as sales ON DATE(appointments.date) = DATE(sales.date_sold)
To my query, it boosts the time for the script to run from about 8 seconds, to 2-3 minutes.
Would there be some data causing this problem or am I not implementing the function correctly?
I need to use DATE() because I need them to be the same day but the date fields are DATETIME