I am trying to get counts for last 30 days with the following query -
SELECT date_occured, COUNT(*) FROM problem WHERE date_occured >= (CURRENT_DATE - 30) GRO
I think you'll want to trunc in the select part too:
SELECT TRUNC(date_occured) AS short_date_occured, COUNT(*) FROM problem WHERE date_occured >= trunc(SYSDATE- 30) GROUP BY short_date_occured;