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

Time Group Range Problem

Status
Not open for further replies.

gscheepers

IS-IT--Management
Jan 21, 2002
150
US
Hi,

I've got a problem grouping a range of times together. Currently I've got a formula that sums the the time a particular client has spend on a project. What I now need to do is to group them together in ranges as follows:

0 to 1:59hrs
2 to 8:59hrs
9 to 15:59hrs
16 to 22:59hrs
23 to 29:59hrs
30hrs +

I thought it would be as simple as doing:

{field} in 0 to 01:59...

This is the formula I'm using to generate the field:

WhilePrintingRecords;
NumberVar TotalSec := {@2.3TotalTimeSec};
NumberVar Hours := Truncate (TotalSec / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);

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

Thanks, Gerhard Scheepers
BA - LETEC
 
That formula should work, assuming your time string is zero padded. However if {@2.3TotalTimeSec} uses a summary operation, you wont' be able to group on either formula. CR does the totals after the groups are done.

Are you getting an error message? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top