Topic Options
#56924 - 04/04/19 12:31 PM @DaysBetweenDates()
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Has anyone used this function from the Date library?

I can't figure out what parameters it expects. Everything I enter gives an error message, but some of the error messages are right off the side of the dialogue box so you can't read them.

Of course, you can't file anything with errors, so I can't just create a dummy condition (for example) and then convert to PressTalk so I can see any comments.

Any advice or experiences with this function would be appreciated.

Thanks in advance!

Top
#56931 - 04/04/19 05:58 PM Re: @DaysBetweenDates() [Re: rfielder]
Philippe F. Online   content
OL Expert

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
This code returns the number of days between April 1st and January 1st 2019:
Code:
@DaysBetweenDates('2019-01-01','2019-04-01','YYYY-MM-DD')

yields the correct value: 90

You must specify the earlier date first, and the latter date next. Then you supply the format your dates are using.

So the same result would be returned with a different format:
Code:
@DaysBetweenDates('01/01/2019','04/01/2019','MM/DD/YYYY')
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#56933 - 04/05/19 08:47 AM Re: @DaysBetweenDates() [Re: rfielder]
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Philippe:

Thanks!

Perhaps I am using it in the wrong place. I am using it as an Advance Condition for a Condition. The error message is "Incomplete Function".

I do have the other three global functions in the form, and @DaysBetweenDates() is the last of the four.

My goal is to build a condition what will compare the current date to a billing date, and test to see if the difference is between 25 and 35 days. Perhaps my approach of putting this in a Condition is incorrect?

Top
#56934 - 04/05/19 02:39 PM Re: @DaysBetweenDates() [Re: rfielder]
Philippe F. Online   content
OL Expert

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
I just tested it inside a condition and it works fine.

Here's my advanced condition:
Code:
=(@DaysBetweenDates(@(4,71,80),'2019.03.01','YYYY.MM.DD'))>30


Where @(4,71,80) is my data selection on the current data page.

Not quite sure where the Incomplete function message stems from. Is that when you build your condition or does it occur on the object to which the condition is applied?
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top