SSRS: Convert decimal to hours and minutes

前端 未结 1 1997
走了就别回头了
走了就别回头了 2021-01-24 16:19

I have a report where I want to display time in hours and minutes (17hrs 30 mins)

The dataset returns this value in decimals (Eg 17.5)

How would I convert this

相关标签:
1条回答
  • 2021-01-24 16:51

    This works for your particular example:

    =Floor(Fields!MyValue.Value)
        & " hrs "
        & CInt((Fields!MyValue.Value - Floor(Fields!MyValue.Value)) * 60) & " mins"
    

    You may need to tweak for all possible scenarios but this should be a good starting point.

    0 讨论(0)
提交回复
热议问题