Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToText evaluates the same number differently.

Status
Not open for further replies.

Crewdawg

Technical User
Oct 29, 2005
30
US
I am running CR 10 on SQL2000 via OBDC.

I have a report which summarizes times for payroll. I use the following formula to convert the database text field which stores the time in the hh.mmm format into minutes.

Code:
//@ActTimeConv
(truncate({TIME_DURATION})*60)+(({TIME_DURATION}-truncate({TIME_DURATION}))*100)

Then ActTimeConv is evaluated with a running total ({#1EmpActT}). This running total in minutes is then converted back to hours and minutes by this formula.

Code:
//@1EmpActConv
if isnull({#1EmpActT}) then
"00:00"
else
totext(truncate({#1EmpActT}/60),"00")+":"+totext(remainder({#1EmpActT},60),"00")

I have two persons on this report (which is grouped by employee code) both with a total of 2400 minutes for the week (aka 40 hours). One individual displays as 39:60, the other as 40:00.

The image below is a picture highlighting what I have found. The blue text is the running total output ({#1EmpActT}).


repexample1.JPG


What causes Crystal to evaluate the same number (2400) differently for those two lines and what can I do to prevent this from happening.

-Sean H
----------------------------------------
Multithreading is just one thing after, before, or simultaneous with another.
 
I apologize for posting here. I thought I was in the CR forum.

-Sean H
----------------------------------------
Multithreading is just one thing after, before, or simultaneous with another.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top