
trouble with converting and adding times
Hello,
I am writing a timesheet report that uses GoldMine as the database backend.
Bascially, the end user schedules a next activity on their calendar for the
office manager and the reference line is Sign In or Sign Out.
So right now my select expert is pointing to cal.userid=HEATHER. Then I have
my group #1 sorting by cal.createby (that gives the username who created it)
The date is sorted by cal.ondate and I have that going thru 2 parameters
(begin and end date)
The sign in/out is cal.ref and the time is cal.createat The third group is
grouped by the cal.ref. The report looks like this
User: REBECCA
Monday 5/19/2003
Sign In 9:00 a.m.
Out to Lunch 12:00 p.m.
Back from Lunch 1:00 p.m.
Sign Out 5:00 p.m.
**this is where I wanted the hours worked displayed.Then it moves to the
next person.
piece 1:
stringvar StartText := "";
stringvar EndText := "";
stringvar OutToLunchText := "";
stringvar BackFromLunchText := "";
I put that in the group(#1) that is cal.createby (the user). I think that it
is doing absolutely nothing. but it is there
piece 2;
stringvar StartText;
stringvar EndText;
stringvar OutToLunchText;
stringvar BackFromLunchText;
if {cal.ref} = "Sign In" then StartText := {cal.createat}
else if {cal.ref} = "Sign Out" then EndText := {cal.createat}
else if {cal.ref} = "Sign Out for Lunch" then OutToLunchText :=
{cal.createat}
else if {cal.ref} = "Sign In from Lunch" then BackFromLunchText :=
{cal.createat}
else "";
I put this in the footer for the ins-outs group(#3)
piece 3:
stringvar StartText;
stringvar EndText;
stringvar OutToLunchText;
stringvar BackFromLunchText;
numbervar timeinseconds := 0;
if StartText <> "" and EndText <> "" then
timeinseconds := ctime(EndText) - ctime(StartText);
if OutToLunchText <> "" and BackFromLunchText <> "" then
timeinseconds := timeinseconds - (ctime(BackFromLunchText) -
ctime(OutToLunchText );
timeinseconds/(60*60) )
I put this in the group(#2) cal.ondate so it knows to display per day.
cal.createat is character field not true numeric/date. I do not know if that
is my problem and I need to convert it. But right now all that shows up is 0