Skip to main content
Solved

Formula to convert date to numbers

  • December 1, 2021
  • 1 reply
  • 49 views

I extract only year from date field with DATETIME_FORMAT(Date, 'YYYY') and assign it to new field.
If I order by that field it isn’t recognized as number, but as a string (the option is A-Z or Z-A).

How can I change it to a number?

Best answer by ScottWorld

Welcome to the community, @Edoardo_StefaniL!

Use the YEAR function instead:

YEAR(Date)

1 reply

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • December 1, 2021

Welcome to the community, @Edoardo_StefaniL!

Use the YEAR function instead:

YEAR(Date)