Page 1 of 1

datediff function

Posted: Tue Nov 29, 2016 10:00 am
by xiaochris
Hello,

how do i find the difference between 2 dates using this function?

{datediff(startdate,enddate).Days}

I tried this but to no avail. what format should i set for this?

Re: datediff function

Posted: Wed Nov 30, 2016 11:08 am
by HighAley
Hello.

Could you specify which components you are using? Flash or JS?

Thank you.

Re: datediff function

Posted: Mon Jan 28, 2019 7:43 am
by ash22
Hello,
I am facing the problem in DateDiff function. I am using the JS component.
This is the whole expression where I am using:
Round(((DateDiff(SessionsAttended.OUT1,SessionsAttended.IN1))/1000)/60,0) where OUT1 = '2019-01-13 04:53:00' and IN1 = '2019-01-13 04:53:00'
It is throwing an error:
Parser error: Operator '/' cannot be applied to operands of type 'TimeSpan' and type 'Decimal'
Can you help me to solve this problem?

Re: datediff function

Posted: Mon Jan 28, 2019 8:53 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data which reproduces the issue for analysis

Thank you.

Re: datediff function

Posted: Wed Jan 30, 2019 6:15 am
by ash22
Hello,
Sorry due to security and complexity of project I won't be able to provide you with the test report.
I can clear you out what I want, I just needed the date difference of 2 DateTime fields in minutes. i.e. IN1 and OUT1 fields as mentioned in my previous post.
So is there any predefined function for that in JS component so I can work on that.
Any help will be appreciated.

Thanks

Re: datediff function

Posted: Thu Jan 31, 2019 7:11 am
by Lech Kulikowski
Hello,

You can sue the following expression:
{DateDiff(Variable1, Variable2).TotalMinutes}

Thank you.