Count the actual number of days - in a year

What would the expression look like to count the number of days in the year to date? This should change according to the day…

I just had to make this one for myself, here ya go:

FLOOR(TOTALHOURS(
[DateTime] - DATETIME(CONCATENATE(“01/01/”, YEAR(DATE([DateTime])), " ", “00:00:00”,))
)) / 24

This assumes you’ve got a DateTime column.

2 Likes

Can I create a virtual date column to use?


MultiTech_Visions

February 8
I just had to make this one for myself, here ya go:

FLOOR(TOTALHOURS(
[DateTime] - DATETIME(CONCATENATE(“01/01/”, YEAR(DATE([DateTime])), " ", “00:00:00”,))
)) / 24

This assumes you’ve got a DateTime column.

The following gives you the day of the year (for today):

FLOOR(TOTALHOURS(
NOW() - DATETIME(CONCATENATE(“01/01/”, YEAR(Date(Now())), " ", “00:00:00”,))
)) / 24

Gave me the following result when I tested it:
image

Which is the day of the year for the date when I ran that test:

1 Like

Thank you -i will try this out today. Thanks again…

1 Like

You’re welcome; just a few hours before you posted your question I was figuring out how to do that for an app. :nerd_face:

Ha. Was meant to be! Thanks again…

1 Like