jenhil34 jenhil34 - 1 year ago 78
SQL Question

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download