Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports Round time to nearest Quarter

Posted on 2014-07-29
3
Medium Priority
?
1,000 Views
Last Modified: 2014-07-30
I have a DateTime Var  that I need to round to the nearest quarter.
7:19 AM, round to 7:15 am,.......Normal rounding rules for time values.
If I need to convert to decimal time, then round, and change back to normal time, not sure how to go about that, if you could help.
Thanks
0
Comment
Question by:BKennedy2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 40227595
You could convert the time to minutes then round using a formula like below then convert back to time

Round ( {database.field} / 4, 0 ) * 4

You can also create a formula that tests for intervals in the minutes and rounds the time.

mlmcc
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 40227700
Here is a formula that does it without converting to minutes

If Minute({Sheet1_.Time on}) <= 7 then
    DateTime(Date({Sheet1_.Time on}), Time(Hour({Sheet1_.Time on}),0,0))
Else If Minute({Sheet1_.Time on}) <= 22 then
    DateTime(Date({Sheet1_.Time on}), Time(Hour({Sheet1_.Time on}),15,0))
Else If Minute({Sheet1_.Time on}) <= 37 then
    DateTime(Date({Sheet1_.Time on}), Time(Hour({Sheet1_.Time on}),30,0))
Else If Minute({Sheet1_.Time on}) <= 52 then
    DateTime(Date({Sheet1_.Time on}), Time(Hour({Sheet1_.Time on}),45,0))
Else 
    DateTime(Date({Sheet1_.Time on}), Time(Hour({Sheet1_.Time on}),0,0))

Open in new window


mlmcc
0
 

Author Closing Comment

by:BKennedy2008
ID: 40229875
Thanks again- You have been a time-saver for sure for not re-creating the wheel!
I basically used your formulas without converting into my report with small modifications.
Thanks Again-
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question