It's me again. I still am working in this *#$%-ing report and I still need help with the last piece.
In case everyone has blocked this from their memory, let me give you the 411.
These people use GoldMine(dbase) to log in and out everyday. There are 4 things that they must record. They use the scheduled activity "next action" So when the come in they schedule a next action and put in the reference "Sign In". When they go to lunch "Sign Out For Lunch" when they come back "Sign In From Lunch" and when they leave "Sign Out". When they schedule these activities GoldMine time stamps it and sticks that value into {cal.createat}I need to display all of these times and then figure out how many hours they worked (which is Sign out - Sign In) I need it displayed properly such as 4 hours 25 min.
For the lunch sign in/out, I created a subreport to display those times. The main report is for the Sign In/Out. I have in the select expert:
{Cal.ONDATE}>={?Begin Date} and {Cal.ONDATE}<={?End Date}
I then have 3 groups:
1. {cal.createby} - that will produce the username
2. {cal.ondate} - to get the date
3. {cal.ref} - I have this one just showing Sign In/Out and discarding the others.
The report groups everything just fine. On my last post Ken Hamady suggested a formula to get the time worked:
If trim({cal.ref})="Sign Out" then
TimeValue ({cal.Createat}) -
TimeValue (Previous({cal.Createat} ))
It is accurate but displays it in seconds instead of hours and minutes. I posted this on experts exchange and someone suggested the following formula:
numberVar TimeSpent;
numberVar Hours;
numberVar Minutes;
If trim({cal.ref})="Sign Out" then
TimeSpent := TimeValue ({cal.Createat}) - TimeValue (Previous({cal.Createat} ))
Hours := Truncate(TimeSpent / 3600);
Minutes := Truncate(Remainder(TimeSpent, 3600) / 60);
ToText(Hours,00) + ":" + ToText(Minutes,00)
I can understand what it is trying to acheive but Crystal does not like the last 3 lines - the error is the remaining text does not appear to be part of the formula.
One last thing. The cal.createat is displayed in military time and is not a datefield it is a character field (or numeric text)
Any ideas? Sorry this is so long.
TIA
Andrea
In case everyone has blocked this from their memory, let me give you the 411.
These people use GoldMine(dbase) to log in and out everyday. There are 4 things that they must record. They use the scheduled activity "next action" So when the come in they schedule a next action and put in the reference "Sign In". When they go to lunch "Sign Out For Lunch" when they come back "Sign In From Lunch" and when they leave "Sign Out". When they schedule these activities GoldMine time stamps it and sticks that value into {cal.createat}I need to display all of these times and then figure out how many hours they worked (which is Sign out - Sign In) I need it displayed properly such as 4 hours 25 min.
For the lunch sign in/out, I created a subreport to display those times. The main report is for the Sign In/Out. I have in the select expert:
{Cal.ONDATE}>={?Begin Date} and {Cal.ONDATE}<={?End Date}
I then have 3 groups:
1. {cal.createby} - that will produce the username
2. {cal.ondate} - to get the date
3. {cal.ref} - I have this one just showing Sign In/Out and discarding the others.
The report groups everything just fine. On my last post Ken Hamady suggested a formula to get the time worked:
If trim({cal.ref})="Sign Out" then
TimeValue ({cal.Createat}) -
TimeValue (Previous({cal.Createat} ))
It is accurate but displays it in seconds instead of hours and minutes. I posted this on experts exchange and someone suggested the following formula:
numberVar TimeSpent;
numberVar Hours;
numberVar Minutes;
If trim({cal.ref})="Sign Out" then
TimeSpent := TimeValue ({cal.Createat}) - TimeValue (Previous({cal.Createat} ))
Hours := Truncate(TimeSpent / 3600);
Minutes := Truncate(Remainder(TimeSpent, 3600) / 60);
ToText(Hours,00) + ":" + ToText(Minutes,00)
I can understand what it is trying to acheive but Crystal does not like the last 3 lines - the error is the remaining text does not appear to be part of the formula.
One last thing. The cal.createat is displayed in military time and is not a datefield it is a character field (or numeric text)
Any ideas? Sorry this is so long.
TIA
Andrea