Page 1 of 1

Calulating staff absences

Posted: Wed Jul 04, 2012 7:18 am
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-)

Re: Calulating staff absences

Posted: Wed Jul 04, 2012 10:49 am
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

Re: Calulating staff absences

Posted: Tue Jul 10, 2012 6:55 am
by Ivan
Hello,

Let us know if you need any additional help.

Thank you.