I'm having an issue writing a query. I have two tables I want to pull data from, sales and calls. There is a column in both tables where a phone number is recorded, as well as a date column. I can do the JOIN just fine to match calls to sales, however I want to also show entries from both tables that don't match. Basically on a single page show the rows that match from both tables, then the rows that didn't match from each table separately.
Here is the JOIN query:
SELECT
sales.*,
calls.*
FROM `sales`
JOIN `calls`
ON sales.TelephoneNo = calls.TelephoneNo
WHERE (
sales.OrderDate >= '$MyStartDATE'
AND sales.OrderDate <= '$MyEndDATE'
) AND (
calls.CallDate >= '$MyStartDATE'
AND calls.CallDate <= '$MyEndDATE'
) ORDER BY sales.OrderDate