Skip to main content
Solved

Formula for day of the year

  • September 10, 2021
  • 3 replies
  • 50 views

Forum|alt.badge.img+5

I’m probably missing something, but how do I get the current day of the year? For instance, we have WEEKNUM(TODAY()), but not DAYNUM(TODAY())?

I can do year(today()), and week(today() but when I do day(today()) it shows the day of the month and not the year. Thanks!

Example: Jan 1st 2021 is day 1, etc.

Best answer by Dominik_Bosnjak

Easiest way that comes to mind:

DATETIME_FORMAT(NOW(),"DDD")

Edit: Bookmark this page and ride off into a meticulously formatted sunset. :horse_racing:

3 replies

Forum|alt.badge.img+17
  • Inspiring
  • 262 replies
  • Answer
  • September 10, 2021

Easiest way that comes to mind:

DATETIME_FORMAT(NOW(),"DDD")

Edit: Bookmark this page and ride off into a meticulously formatted sunset. :horse_racing:


Forum|alt.badge.img+3
  • Participating Frequently
  • 7 replies
  • February 3, 2023

I wanted record grouped by the date the record was created. 


GrahamW
Forum|alt.badge.img+12
  • Known Participant
  • 31 replies
  • October 10, 2023

Easiest way that comes to mind:

DATETIME_FORMAT(NOW(),"DDD")

Edit: Bookmark this page and ride off into a meticulously formatted sunset. :horse_racing:


Hi @Dominik_Bosnjak -- thanks for this.

Curious though why I can't take the product of this formula and use it in a percentage formula. 

For example, if I take your fomule and divide by 365, I get an error:

DATETIME_FORMAT(NOW(),"DDD")/365
 
 
What am I doing wrong? 

Please and thank you 🙏