Convert decimal to SSRS / SQL time

I have a decimal field in an SQL database that only stores time. Below is the data that appears, and the final result that I would like to display in the SSRS report. The solution can be either in the SQL query, or, possibly, in some type of formatting / expression of SSRS.

Data Desired Result 6.50 6:30:00 AM 14.25 2:25:00 PM 17.75 5:45:00 PM 8.00 8:00:00 AM 

I am very grateful for any help with this.

+5
source share
1 answer

Well, this may not be very pretty, but it gives you the result you are looking for:

 select convert(time(0), convert(smalldatetime, (6.50/24))) 

Result:

 06:30:00 

Replace 6.50 with your column name.

+6
source

Source: https://habr.com/ru/post/1270931/


All Articles