datediff function

Stimulsoft Reports.PHP discussion
Post Reply
xiaochris
Posts: 26
Joined: Wed Feb 03, 2016 1:27 am

datediff function

Post 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?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: datediff function

Post by HighAley »

Hello.

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

Thank you.
ash22
Posts: 3
Joined: Mon Jan 28, 2019 5:54 am

Re: datediff function

Post 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?
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: datediff function

Post by Lech Kulikowski »

Hello,

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

Thank you.
ash22
Posts: 3
Joined: Mon Jan 28, 2019 5:54 am

Re: datediff function

Post 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
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: datediff function

Post by Lech Kulikowski »

Hello,

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

Thank you.
Attachments
01.jpg
01.jpg (148.41 KiB) Viewed 4367 times
02.jpg
02.jpg (45.8 KiB) Viewed 4367 times
Post Reply