| Author |
Message |
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Topic: time field problem Posted: 16 Feb 2010 at 11:50am |
|
hi everyone.......
I'm new, so please help me..I'm having a problem in my report..I can't compute the fields for time..I'm making a report for attendance and the computation of the time field..my report looks like
TimeInAM | TimeOutPM | TimeInPM | TimeOutPM | Total
hh:mm:sss hh:mm:sss hh:mm:sss hh:mm:sss ???? hh:mm:sss hh:mm:sss hh:mm:sss hh:mm:sss ????
Total time: ????
|
|
lup
|
IP Logged |
|
|
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 16 Feb 2010 at 1:28pm |
are all 4 fields always filled in?
if so just use a datediff formula to get the values:
datediff('n',timeinAM,TimeOutPM) +
datediff('n',timeinPM,TimeOutPM)
|
IP Logged |
|
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Posted: 16 Feb 2010 at 9:02pm |
|
hello..
not all the fields are always filled..because its attendance computation.. will this formula work??
|
|
lup
|
IP Logged |
|
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Posted: 16 Feb 2010 at 9:11pm |
|
hi.. it ddn't work..theres an error: A Date is required here..
|
|
lup
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 17 Feb 2010 at 7:20am |
1. Since not all fields are always filled in how do you handle this? Does that mean that at least field 1 and 2 are filled or 3 and 4 are filled?
2. Since you are getting that error what is the field type for these 4 'time' fields?
|
IP Logged |
|
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Posted: 17 Feb 2010 at 11:47am |
|
hi..
1. Yes, because the employee my be absent for am and present on pm.. 2. What to you mean by field type?in my DB the data type of the fields is time.
|
|
lup
|
IP Logged |
|
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Posted: 17 Feb 2010 at 11:49am |
|
hi..
1. Yes, because the employee my be absent for am and present on pm.. 2. What to you mean by field type?in my DB the data type of the fields is Time.
please help me..
|
|
lup
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 17 Feb 2010 at 1:19pm |
Maybe this?
(If isnull(timeinAM) or isnull(timeOutPM) then 0 else
datediff('n',cdatetime("1/1/1900" +totext({InTImeAM})),cdatetime("1/1/1900" +totext({TimeOutPM})))
+
(If isnull(timeinPM) or isnull(timeOutPM) then 0 else
datediff('n',cdatetime("1/1/1900" +totext({InTImePM})),cdatetime("1/1/1900" +totext({TimeOutPM})))
|
IP Logged |
|
lupao
Newbie
Joined: 16 Feb 2010
Online Status: Offline
Posts: 6
|

Posted: 17 Feb 2010 at 11:56pm |
|
Hello DBlank..can you please provide me the complete code?
|
|
lup
|
IP Logged |
|
|
|