Convert to hh:mm

  • In one of my reports I have the following data

    CallID             Officer             TimeSpent(Minutes)

    100                JBloogs             1             81

    100                BSmith              80

    101                JJones              45            85

    101                SLow                40  

    You will notice the 81 and 85 are totals for the GROUPED CallID. These totals are done in reporting services. What I now need to do is convert that total to hh:mm. So, 81 becomes 1:21 and 85 becomes 1:25. Is this possible in Reporting Services. If so, can someone please assist me?

    I can't do it via my stored procedure in SQL Server because there are other columns that I need to display and it will ruin the GROUPING. So I have to do it via reporting services.


    Kindest Regards,

  • This was removed by the editor as SPAM

  • Can't you use the mod (ie modulo) function to achieve this? 

    ie (in pseudo code) = SUM(somefield) / 60 & ":" SUM(somefield)%60

    I'm not sure what modulo is in VB.net but it shouldn't be hard to look it up in the help.  You may need to convert the first part to ensure tat it returns an int but again I think using a particular operator for the divide will ensure that you get an int not a float.

     

    Steve.

  • I assume that your total time spent formula is something like Sum(CallID) which would be the grouped total.  To convert to H:mm use something like this instead of the Sum(CallID):

    =Int(Sum(CallID)/60) & ":" & Sum(CallID) Mod 60

    Iv'e tried this as a standalone VB script substituting 81 for Sum(CallID) and it gives the format you want - 1:21.

     

    Regards

    Terry

     

     


    Best Regards
    Terry

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply