I want to pull data from a table, but I want to pull all the reasons and show 0 if there is no entry for the day.
This what I want the data to look like
When I run this query, I only get Not Interested and Invalid Contact, is there a way to pull all the reasons and pull the number, 0 if null
SELECT Reason, Count(ID) from t_customers
where createddate = getDate()
group by Reason
I dont want to hardcode the reasons, as i want to include any new ones that might be added, so if I run this query it pulls all possible entries, and this list is what i want to utilize for the report.
select reason from t_customers
group by reason