locked
SQL Server 2008 Time format with time datatype RRS feed

  • Question

  • Hi,
    I am using a "time" datatype for a column. During data retrival from this column, i want time in "HH:MM AM/PM". How to convert time into HH:MM AM/PM
    Thanks & Regards,
    Priyaa Saxena
    Wednesday, October 14, 2009 5:13 AM

Answers

  • use =format(Fields!timecolumn.value, "hh:mm")  HH:mm will format it in 24hour timeclock.  the capital MM is only used for months.
    Wednesday, October 14, 2009 5:35 AM

All replies

  • use =format(Fields!timecolumn.value, "hh:mm")  HH:mm will format it in 24hour timeclock.  the capital MM is only used for months.
    Wednesday, October 14, 2009 5:35 AM
  • Hi! I am also having the same problem, I have a field defined as Time, and when I try putting the format string as "hh:mm" or even as "Tt" as it was in Report Server 2005, I get an #Error in the field, and there is a warning that shows up:

    Warning 1 [rsRuntimeErrorInExpression] The Value expression for the textrun ‘StartTime.Paragraphs[0].TextRuns[0]’ contains an error: Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'. C:\Users\Administrator\Documents\Visual Studio 2008\Projects\EmployeeTime\EmployeeTime\Employee Time Report.rdl 0 0 

    Any thoughts? Thanks for the help!
    Thursday, October 15, 2009 10:04 PM