Error: Group by a time field to see how this has changed over time

I'm trying to build a trend chart from the data using the following sql query

SELECT date_first_available, COUNT(*) AS product_count
FROM amazon
WHERE date_first_available IS NOT NULL
GROUP BY date_first_available
ORDER BY product_count desc;

The data is showing up as expected. See the image below.

However, when i'm trying to create a trend chart - it is showing an error: " Group by a time field to see how this has changed over time" . In my query, i've already grouped by the date. What is wrong with my approach?

Hey, do you know if the data type of date_first_available is a string or a date/timestamp/datetime?

You could try casting the column to a date or timestamp in your SQL query. Let me know if that works :slight_smile:

You were right. Silly me