Date time conversion.

  • I am working on an SSRS report and the query I am using returns a date time value of '2018-01-01 11:07:12.000'. I need to display only the hours and minutes and the format using this example would be 1107. I tried using datepart(sql) and concatenating the two values but datepart returns an integer value and drops the leading 0 in the minutes. Thank You!

  • wwright 50911 - Friday, February 9, 2018 10:29 AM

    I am working on an SSRS report and the query I am using returns a date time value of '2018-01-01 11:07:12.000'. I need to display only the hours and minutes and the format using this example would be 1107. I tried using datepart(sql) and concatenating the two values but datepart returns an integer value and drops the leading 0 in the minutes. Thank You!

    Have you tried the FORMAT function? To be clear, the one on SSRS not on T-SQL.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Yes I have. I am going to close this post. I get the dum ass of the day award. After I made the post I got to looking at the table and discovered what I was looking for already had a column for time in the format I needed.

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

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