Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If else condition Problem Post Reply Post New Topic
Author Message
Essel
Newbie
Newbie


Joined: 14 Dec 2010
Online Status: Offline
Posts: 5
Quote Essel Replybullet Topic: If else condition Problem
     Posted: 02 Mar 2011 at 9:37am
Please can anyone help me fix this error of mine.The problem is i have a clockInTime and ClockOuttime Fields in my database.What i want to do is to get the difference between these Clockin and Out time but when some clocks in and has not yet clock out it should display Not Clock out and the deference should be 00:00:00.I am using this crystal syntax but it is give me an error message.Please help me

Local DateTimeVar COut=12:00:00
if{ClocksTable.ClockOutTime}=COut then
COut-Cout
{ClocksTable.ClockOutTime}="Not Clock Out"
else
{ClocksTable.ClockOutTime}-{ClocksTable.ClockInTime}


//Please for a explanation this was how i implemented this in vb.net and it is giving me the correct data but how to do this in crystal is very difficult
??VB
'If the person is not clocked out then we write not clockout and the difference
               'will be 0
               If ClockOutTime = "12:00:00 AM" Then
                    TimeDiffs = TimeValue(ClockOutTime) - TimeValue(ClockOutTime)
                    ClockOutTime = "Not Clock Out"
               Else
                    TimeDiffs = TimeValue(ClockOutTime) - TimeValue(ClockInTime)
               End If

Edited by Essel - 02 Mar 2011 at 9:40am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 02 Mar 2011 at 9:55am
What is the error message? Did it highlight something?

COut-Cout <-- this part seems to be a typo.
IP IP Logged
Essel
Newbie
Newbie


Joined: 14 Dec 2010
Online Status: Offline
Posts: 5
Quote Essel Replybullet Posted: 02 Mar 2011 at 10:01am
That part i want to use it for subtraction but the error message is.this string required.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum