You must Sign In to post a response.
  • Category: SQL Server

    SSRS export into excel as Time format

    Hi All,

    I want to show seconds into format (HH:MM:SS) and value should work as time duration in excel export.
    I am getting input as seconds (for example 93600 seconds),
    and i need to show the seconds into HH:MM:SS format.

    Am succeeded to show time(HH:MM:SS) in text format. But the problem which i am facing after excel export. We cannot able to sum up multiple cells, as it is string.

    The output which i need is [26]:00:00.
    other example of output are [502]:34:56, [1020]:55:45

    Thanks in Advance.
  • #764099
    You can convert the seconds into time using TimeSpan
    You can try the following code.

    var MyTimeSpan = TimeSpan.FromSeconds(totalsecond);
    string ResultL = string.Format("H: {0} M:{1} S:{2}", MyTimeSpan.Hours, MyTimeSpan.Minutes, MyTimeSpan.Seconds)

    By Nathan
    Direction is important than speed

  • Sign In to post your comments