none
convert decimal to datetime (HH:MM)

    Question

  • Is it possible in Reporting Services 2008 to convert a decimal to a datetime format of HH:MM? I am pulling data from SSAS and in order to get the value of time into the cube as a measure I needed to convert the time to a float and then pass it into the cube. SSAS knows how to conert it by specifiying the format as hh:mm. Unfortunately SSRS seems it is ignoring the format and using the decimal value. Example

    0.188194444446708 = 4:31am

    SSRS is pulling in the decimal not the formatted time (4:31) like SSAS

    anyone know how to convert this to time?
    FJK
    Monday, November 02, 2009 11:18 PM

Answers

All replies

  • If you do a conversion in T-Sql, like so: select convert(datetime,@t), it will give you this result:
    1900-01-01 04:31:00.000 .. Is this something you want? You can do the conversion in T-Sql and format it accordingly in SSRS to get the time. hth.
    Chicagoan ...
    Tuesday, November 03, 2009 3:17 PM
  • not exactly. I am pulling the decimal representation of time out of a SSAS cube and need a way to convert it to time in SSRS.

    Excel does this out of the box, SQL Server does this, SSAS does this, but so far SSRS does not that I can tell.
    FJK
    Tuesday, November 03, 2009 3:38 PM
  • In SSRS, try this expression:

    =Date.FromOADate(0.188194444446708)


    Chicagoan ...
    • Marked as answer by Frank Kearney Tuesday, November 03, 2009 4:34 PM
    Tuesday, November 03, 2009 3:45 PM
  • works perfect! Is that a VB function?
    FJK
    Tuesday, November 03, 2009 4:08 PM