trouble with converting and adding times 
Author Message
 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



Sun, 06 Nov 2005 05:26:56 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. help how to convert time string into time format

2. converting PST/PDT time to GMT time

3. How to Convert GMT(Greenwich) Time to short date and time and vice versa

4. medium time automatically converted to long time.

5. Converting %date% %time% to VB Time/Date

6. Convert from system time to unix time

7. Convert Universal times and Local Times

8. Trouble Converting From 97 to 2000

9. Time stamping the time a record was added to a table

10. Calculating elapsed time and adding time values

11. Add Time zone to time received field in message

12. Adding a Form to a VB Add-In at Run time

 

 
Powered by phpBB® Forum Software