Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Time round to nearest quarter Post Reply Post New Topic
Author Message
Beso90
Groupie
Groupie
Avatar

Joined: 12 Jun 2014
Location: United States
Online Status: Offline
Posts: 48
Quote Beso90 Replybullet Topic: Time round to nearest quarter
    Posted: 15 Aug 2018 at 12:38pm
Hello,

I have a formula field called {@originaltime}
that has the following formula inside of it:
If isnull({CLOCK_IN_OUT.ORIGINAL_TIME_IN_OUT})
then Time({CLOCK_IN_OUT.TIME_IN_OUT})
else time({CLOCK_IN_OUT.ORIGINAL_TIME_IN_OUT})


and that generates a time of punch in for me

I would like to apply a time rounding rule to nearest quarter. but whether it rounds up or down is based of where within the quarter the time falls.
if it's within the first 7 minutes of the quarter, I need it to round DOWN, if it's after the 7 minutes, I need it to round UP.

Thank you!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Aug 2018 at 4:32am
I assume this is a datetime field and you need to possible round up to midnight on the following day.

probably need to take midnight for the same date, do a date diff between those to get the total minutes of the day, round using 15, then add that result back to the midnight date value
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.