AnsweredAssumed Answered

Setting a field to the nearest 15min

Question asked by NathanVeitch on May 17, 2013
Latest reply on May 17, 2013 by philmodjunk


Setting a field to the nearest 15min


     Hi There,


     I need to find out what would be the best method for calculating a field to the nearest 15min. Im working on a clock in system. I was thinking of having a button that the user presses and it can get current time. That is the easy part. What I would like to be able to do is convert that time down to the nearest 15min. So if they press the button at 7:10 the time captured would be 7:00. 


     Would I need to use a case statement  along the lines? I have an idea that the logic behind the case would be something along the lines of,


     Min(Time) < 15; Min(Time) = 00;

     Min(Time) < 30; Min(Time) = 15;

     Min(Time) < 45; Min(Time) = 30;

     Min(Time) = 45


     I tried this calculation but it doesn't quite work :$