12 Replies Latest reply on Mar 10, 2015 1:19 PM by isiojac@gmail.com

# DayOfYear () 2014 to 2015

Hi,

As 2015 started, my DayOfYear () numbers were reset. So, as an example, 01/15/2014 is the same as 01/15/2015. Any clue on how could I continue counting through 2015 without reseting DayOfYear () to the beginning?

Tnx.,

IJ

• ###### 1. Re: DayOfYear () 2014 to 2015

Hi there,

I don't think I quite understand the issue. DayOfYear() is a count of the days from the beginning of the year to the date specified. Here is the FileMaker Help on it: DayOfYear

Are you looking for another command that gives you the Day Name? That would require the DayName() function.

I hope this helps

• ###### 2. Re: DayOfYear () 2014 to 2015

Hi,

I started a Gantt chart last year for projects that continue through 2015 and beyond. The "X" axis (day calculation) is based on DayOfYear() decimal number. What's happening now is that 2015 data in the Gantt chart is concurrent with 2014, since the decimal number for dates in 2014 are the same as to 2015. All I need is the DayOfYear () decimal number to continue counting over 365 days. I used an If() function to ad 365 to DayOfYear() number when the date year was 2014 but the problem continued. So I'm wondering if there's a function or a way to make DayOfYear to continue counting over 365 days.

• ###### 3. Re: DayOfYear () 2014 to 2015

Continue counting means that somewhere in time you started counting. The day you started counting was day 1. Assign that day to a global variable, then use simple math to find out your count. (if you have 2 dates, d1 and d2, d2-d1 will give you the elapsed days).

• ###### 4. Re: DayOfYear () 2014 to 2015

Get ( CurrentDate ) - Date ( 1 ; 1 ; 2014)

• ###### 5. Re: DayOfYear () 2014 to 2015

David is correct here, but I would make it less static and do

get(currentdate) - date field

If that field exists, otherwise David is right on the money

• ###### 6. Re: DayOfYear () 2014 to 2015

Dates are just a formatting option for a series of numbers, e.g.

31 Dec 2014 is 735598.

1 Jan 2014 is 735599.

2 Jan 2015 is 735600

etc, etc.

Is there not a solution to your problem that can be based on these numbers rather than dates, per se?

I'd be very interested in how you are approaching the Gantt chart issue ...........

Paul

• ###### 7. Re: DayOfYear () 2014 to 2015

This is the problem: I have several projects due dates written as mm/dd/yyyy. When I convert to decimal using DayOfYear(), 1/13/2015=13 and 12/25/2014=359

• ###### 8. Re: DayOfYear () 2014 to 2015

totally forget DayOfYear() please. Convert everything to numbers, with GetAsNumber(Date(m,d,y)) and make your calcs on that. Create your own custom functions to do it, you'll need some for SQL too.

You can build your own DayOfYear() function,  - Date(1;1;year) + yourdate and so on.

• ###### 9. Re: DayOfYear () 2014 to 2015

DayOfYear will ALWAYS deliver the answer 13 for January 13th; that is what you are asking for with this calculation—how many days is whatever date you choose since the beginning of the year it is part of. Asking it to deliver a cumulative result that includes some days in a previous year is not going to happen by itself, although you could construct an elapsed time calculate that includes this function.

• ###### 10. Re: DayOfYear () 2014 to 2015

Hi, I used GetAsNumber() and ti worked just fine.

Tnx,

IJ

• ###### 11. Re: DayOfYear () 2014 to 2015

Great.

Any tips on gantt charting?

Paul

• ###### 12. Re: DayOfYear () 2014 to 2015

Hi Paul.

Sorry, didn't see this post before. Sure, what do you want to know?

IJ