Calulating staff absences

Stimulsoft Reports.WEB discussion
Post Reply
JoM
Posts: 1
Joined: Wed Jul 04, 2012 6:59 am

Calulating staff absences

Post by JoM »

Hi!
I want to report on Staff Absences. I have Start Date and Return Date and have tried using:
{DateDiff(MainData.Return_Date,MainData.Start_Date)}.
Unfortunately if the start and end date are the same it returns 0 - when sensibly it should really be 1.
I also need to return an interger (not date and time).
Can anyone advise me?
Many thanks
8-)
csbrogi
Posts: 89
Joined: Thu May 03, 2012 11:47 am
Location: Germany

Re: Calulating staff absences

Post by csbrogi »

Hi,

since DateDiff returns a TimeSpan object, you can access its properties.
For example

Code: Select all

{DateDiff(ReportChanged,ReportCreated).Days }
returns the number of days.
and if you only want to return a flag, you can use the IIF function

Code: Select all

 {IIF(DateDiff(ReportChanged,ReportCreated).Days != 0, 0, 1) }
HTH
Clemens
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: Calulating staff absences

Post by Ivan »

Hello,

Let us know if you need any additional help.

Thank you.
Post Reply