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

Crosstab/Totalling Hours Problem

Status
Not open for further replies.

jcl5

IS-IT--Management
Dec 6, 2002
89
GB
Hi

I need to create a cross tab which shows the staff in rows, the week number in columns and the number of hours and minutes they've worked each week as the summary field.

First two are ok but but I can't seem to pick up the correct summary for the time worked.

The formula which does the actual count of hours and minutes totals in seconds and then I convert it back to hours and minutes using this formula:

WhilePrintingRecords;
NumberVar TotalSec := Sum ({@durationtoseconds}, {@Week});

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

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

I can use {@durationtoseconds}as the summary field in the crosstab but it returns total seconds but how do I convert it to display in hours and minutes.

Thanks

jcl5
 
I would suggest converting it at the detail level, not the summary,and especially not while using "whileprinting records". In other words, create a formula "durationhours" which would do your above calculations, then subtotal that and use it in the crosstab.
 
Thanks - any suggestions on the formula?. My table holds the time worked in separate fields for days, hours and minutes but I only want to display it in hours and minutes - i.e. 1 day = 7.5 hours, hence the conversion to seconds - I don't know how else to total them.

jcl5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top