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

Seconds Conversion with rounding up at 6 second intervals 1

Status
Not open for further replies.

noslo

Programmer
Dec 10, 2001
24
US
I am using CR 8. I am reporting the total seconds of a call and converting to minutes & seconds. Here is the catch....For any remaining seconds the client wants to round up using an 18/6 methodology.

Simply, anything <= 18 seconds is 18
then round up at 6 second intervals so
from 19 to 24 seconds is 24
25 to 31 is 31 and so on

Examples: 129 seconds would be 2 minutes and 18 seconds
153 seconds would be 2 minutes and 36 seconds

Thanks for any help on this
 
You can try this...

To calculate the number of minutes, use

[tt]
Truncate ({Seconds} / 60) = Minutes
[/tt]

For your 18 / 24 / 30 / etc, try this:

[tt]
if Remainder ({Seconds}, 60) <= 18 then 18
else if Remainder ({Seconds}, 60) in [19 to 24] then 24
else if ...
[/tt]

HTH,
John Marrett
Crystal Reports & Crystal Enterprise Trainer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top