ibanez2727
MIS
Hi all,
I currently have a Crystal Reports 8.5 daily hours report that does a Datediff on the clock-in and clock-out times of a user. This part works fine assuming the user has clocked out. If the user has not yet clocked out the report returns blank. What I am trying to do is get the report to display the daily hours regardless of whether or not the user has clocked out by creating a conditional statement filling in the current date/time when necessary:
--------
if {Time.ClkOut} = #1/1/1900# then
Datediff("n",{Time.ClkIn},CurrentDateTime)
else
Datediff("n",{Time.ClkIn},{Time.ClkOut})
--------
When I run this the report is still blank if the user has not clocked-out.
1/1/1900 is the default for the ClkOut field when the initial entry is made and before it is updated.
Any help would be much appreciated!
I currently have a Crystal Reports 8.5 daily hours report that does a Datediff on the clock-in and clock-out times of a user. This part works fine assuming the user has clocked out. If the user has not yet clocked out the report returns blank. What I am trying to do is get the report to display the daily hours regardless of whether or not the user has clocked out by creating a conditional statement filling in the current date/time when necessary:
--------
if {Time.ClkOut} = #1/1/1900# then
Datediff("n",{Time.ClkIn},CurrentDateTime)
else
Datediff("n",{Time.ClkIn},{Time.ClkOut})
--------
When I run this the report is still blank if the user has not clocked-out.
1/1/1900 is the default for the ClkOut field when the initial entry is made and before it is updated.
Any help would be much appreciated!