Can I use DATEPART() in SQL queries?

In a table where each row has a timestamp, I want to count how many rows there are per month, with something like WHERE DATEPART(month, created_at).

In raw sql you can use anything the underlying DB accepts.

Via the query interface, you could do a COUNT and then group by the month like in the attached screenshot.

1 Like