Just get the month from a date

Hello Retool Community,

I want to convert a full datetime into just a month in both my table and chart. I'm trying to somehow extract the month but don't know how to do so. I know this should be an easy fix. Any help?

Hello!

You could either try to cast the month out from you data source query or format the value in the table/chart mappings.

The former would look something like:

SELECT MONTH(yourDateValue) AS Month

For the latter, you would make a new Date object with moment using something like:

{{ new moment(item).format("MMM") }}

1 Like