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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To Text Time Formatting 1

Status
Not open for further replies.
Jul 1, 2008
37
US
Hello,
I am having a problem with my formatting.

This is my formula:

WhilePrintingRecords;
NumberVar TotalSec := ({sfplan.mrtime}-{sfjobdet.mrtime});

NumberVar Hours := Truncate ( TotalSec / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);

Totext ( Hours, '####') + ':'+
Totext ( Minutes,'00')

And my results show the 4 and the 28 in parentheses for being negative. Then I also did a highlight expert with if the results are < 0 to color red. 0 is coloring red and I didn’t set it up as < >= 0

( 4):(28)
0:00

Any help you can give me will be greatly appreciated.

Thank you,
Angie Christman
 
YOu can either change order of the fields in Totalsec

NumberVar TotalSec := ({sfjobdet.mrtime} -{sfplan.mrtime});

Or return an absolute value

NumberVar TotalSec := abs({sfplan.mrtime}-{sfjobdet.mrtime});

Ian
 
But if the value is negative I still want it to show red. Can that be done in formating?
 
Sorry I thought you did not want to see negative values.

I would base your formating on the var TotalSec.

format the text box font colour

WhilePrintingRecords;
NumberVar TotalSec;

If totalsec < 0 then crred else crblack

Ian



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top