Dividing total minutes into hours & minutes

Posted on 2004-11-20
Last Modified: 2013-12-18
a form has 3 fields

From_Time [Date/Time]
To_Time [Date/Time]

Total_Minutes [Text - Computed]

In a view, I've inserted a column for Total_Minutes. I've selected "Total" under "Totals:" in the 'sorting' tab of the column. This works fine.

Is there any way to divid the minutes of each row/document into hours then minutes. like for 150 minutes, it should show "2 hours 30 minutes" or "02:30" or similar to that

I hope my query is clear to you all. Thanks in advance
Question by:ninteen83
    LVL 24

    Assisted Solution

    Try this formula in the column...

    diff:= To_Time - From_Time;

    timediff := @Text(@Integer((diff - (@Integer(diff/86400)*86400)) /3600)) + ":"
    @Text(@Integer((diff - (@Integer(diff /3600)*3600)) /60)) + ":"
    @Text(@Integer((diff - (@Integer(diff /60)*60))));



    LVL 46

    Expert Comment

    by:Sjef Bosman
    That should not be so very hard, should it?

    Without trying whether the code works (I don't have the time at the moment):
    - create a column with value
        @Time(0; 0; To_Time-From_Time)
    - display the column with Time-only.

    Author Comment

    Hemanth !

    what does  @Text(@Integer((diff - (@Integer(diff/86400)*86400)) /3600)) do ??

    by taking the diff. of From_Time and To_Time, I'm able to take out the hours and minutes. I'm using the following formulas :

    for hours : @Abs(@Integer((To_Time -From_Time)/(60*60)))
    for minutes : @Modulo(Total_Minutes;60)

    I'm not sure whether screenshots are allowed in the forum or not: see the following image.$FILE/lotusnotes.gif

    I've created several documents. I'm able to take the correct duration for each document. e.g. 6 hours, 30 minutes

    the above view has 2 column Hr and Min; Hr is set to take Total of Hours (of multiple docs) and Min is set to take the total of minutes

    in the picture, under PROJECT TRACKING SYSTEM .. it has given [12 75]
    I want it to display 13 hours 15 minutes for PROJECT TRACKING SYSTEM not 12 hours 75 minutes

    is this possible ?
    LVL 46

    Accepted Solution

    Did you try mine? It didn't work, did it? I checked now, the formula needed only a "minor" modification:
        @Adjust(@Time(0;0;0); 0;0;0;0;0;To_Time-From_Time)

    Tested. Works.
    LVL 46

    Expert Comment

    by:Sjef Bosman
    The totals line will never display in a correct format, if there is seconds to minutes overflow. Not if you do it my way, not if you do it Hemantha's way. At least, not up to version R6.0.3. In my case, totals will never display as a time-value unfortunately.. As for splitting the hours and minutes in two different counters: you'll never know the overflow from the minutes to the hours. It is strange that the format of the totals value cannot be defined. I think that's a serious Notes mistake.

    Author Comment

    It is strange that the format of the totals value cannot be defined. I think that's a serious Notes mistake.

    :) you are right sjef_bosman .. IBM should be asked for this.

    my question was not solved and I don't think there is a solution for that. don't want to take back my points .. "eik baar jo diya - so diya" ;) .. I'm dividing it between both of you

    thanks for the help.
    LVL 46

    Expert Comment

    by:Sjef Bosman
    Thanks for points.

    Asking IBM is like saluting the moon... pretty pointless.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now