5 Replies Latest reply on Sep 30, 2016 12:52 PM by Benjamin Greene

# How to get the number of days in current year and previous year?

Hi,

How to get the number of days in current year and previous year?

• ###### 1. Re: How to get the number of days in current year and previous year?

DATEDIFF('day', MAKEDATE(YEAR(TODAY())-1, 1, 1), TODAY())+1

^That will give you the number of days from January 1 of the previous year to today.

DATEDIFF('day', MAKEDATE(YEAR(TODAY())-1, 1, 1), MAKEDATE(YEAR(TODAY()), 12, 31))+1

^That will give you the number of days from January 1 of the previous year to December 31 of the current year.

1 of 1 people found this helpful
• ###### 2. Re: How to get the number of days in current year and previous year?

Same same but different.

• ###### 3. Re: How to get the number of days in current year and previous year?

Can you help me to find out the number of days in Previous year alone. and number of days passed in this current year.My idea is i have to take average sales of year 2016 and average daily  sales of 2015.For that i have to get the number of days in 2015 and number of days in 2016.Can you help me with that?

• ###### 4. Re: How to get the number of days in current year and previous year?

or

DATEDIFF('day', MAKEDATE(YEAR(TODAY())-1, 1, 1), MAKEDATE(YEAR(TODAY())-1, 12, 31))+1

1 of 1 people found this helpful
• ###### 5. Re: How to get the number of days in current year and previous year?

Days in previous year: DATEDIFF('day', MAKEDATE(YEAR(TODAY())-1, 1, 1), MAKEDATE(YEAR(TODAY())-1, 12, 31))+1

Days in this year: DATEDIFF('day', MAKEDATE(YEAR(TODAY()), 1, 1), TODAY())+1

1 of 1 people found this helpful