Hey all,
I'm putting together a simple "Time Clock" program. In the SQL database are stored different rows for clocking IN, OUT, etc. with a DateTime stamp.
In SQL you can use this code to find the hours:
set @Time1 = '12/18/2002 11:00 am'
set @Time2 = '12/18/2002 12:00 pm'
select cast(@Time2-@Time1 as float) * 24 = 1 hour
....now.... I want to do this calculation in Crystal Reports. So, I have the IN and OUT time shared as a dateTimeVar and am trying to do the calcuations like so:
shared DateTimeVar OUT;
shared DateTimeVar INa;
numbervar total;
total := (OUT - INa) * 24;
total;
...but... it is coming out to weird numbers that I'm not sure what is going on. Can anyone help with this some? or maybe suggest a better method here? Thanks
I'm putting together a simple "Time Clock" program. In the SQL database are stored different rows for clocking IN, OUT, etc. with a DateTime stamp.
In SQL you can use this code to find the hours:
set @Time1 = '12/18/2002 11:00 am'
set @Time2 = '12/18/2002 12:00 pm'
select cast(@Time2-@Time1 as float) * 24 = 1 hour
....now.... I want to do this calculation in Crystal Reports. So, I have the IN and OUT time shared as a dateTimeVar and am trying to do the calcuations like so:
shared DateTimeVar OUT;
shared DateTimeVar INa;
numbervar total;
total := (OUT - INa) * 24;
total;
...but... it is coming out to weird numbers that I'm not sure what is going on. Can anyone help with this some? or maybe suggest a better method here? Thanks