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!

Cross Tab - Print Time Formula Not Working

Status
Not open for further replies.

stuckDuck

Programmer
Jun 30, 2010
30
CA
I need a cross tab that sumarized the time for each department. The time on the database is in integers. I need this formula to format the time in a useful manner. I receive an error " A print time formula that modifies variables is used in a chart or map"


Help Appreciated!

NumberVar TotalSec1 := {#rt_subtotal_time};

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


totext(abs({#rt_subtotal_time}/ 3600),"00") & ":" &
totext(abs(remainder({#rt_subtotal_time},3600) / 60),"00");
 
You should use the time in integer datatype for the calculations in the crosstab and then format the results using "display string". I would also avoid using a running total--how is the running total set up? What is your rationale for using a running total?

In display string, you would use:

whileprintingrecords;
NumberVar TotalSec1 := abs(currentfieldvalue);
NumberVar Hours := Truncate(TotalSec1/3600);
NumberVar Minutes := Truncate (Remainder(TotalSec1,3600)/60);
totext(Hours,"00")+":"+totext(Minutes,"00")

-LB
 
thankyou, i will try your suggestion. The running total was used to get the integer sum. I guess the cross tab summary field handles that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top