Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Decimal to Time SSRS/SQL

I have a decimal field in a SQL database that stores time only. Below is the data that is coming across and the end result I would like to display in a SSRS report. The solution could either be in the SQL query or maybe some type of SSRS formatting/expression.

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 greatly appreciate any help with this.

like image 779
jenhil34 Avatar asked Aug 16 '17 16:08

jenhil34


1 Answers

Alright this may not be 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 the 6.50 with your column name.

like image 88
Jacob H Avatar answered Oct 21 '22 13:10

Jacob H