I am building a chart and need to have all of the days of a given month represented for applications submitted. On some days, there may be 5 and on others there may be 0. I am getting my data from an applications table but I need append the string for dates that do not have a value. For example today is 05/29 and 3 people applied. On 05/21, 2 people applied. In between (and before that) no others applied. So I need to get those dates and store a 0 value for them.
Below is what I am using to bring back and group the data:
SELECT DISTINCT to_char ("applicationdate",'mm') AS applicationmonth
, to_char ("applicationdate",'dd') AS applicationdate
, to_char ("applicationdate", 'yyyy') AS applicationyear
, term
, COUNT(*) AS count
FROM campapplications.basketball
WHERE term = 'SU'
GROUP BY applicationdate, term
ORDER BY applicationdate, term
At the end of the day, I am doing an insert.
I have looked other places but could not really get any input outside of using the listAppend()
function.