Wednesday 18 July 2012

SSRS DataType Conversion: char data type to a datetime

Conversion: 
of a char data type to a DateTime data type resulted in an out-of-range DateTime value. It happens because of the date format in table in this format: 2009-01-09 00:00:00.000

You can use CONVERT(varchar, GetDate(), 103). Here 103 is UK regional DateTime format




CONVERT(data_type(length),expression,style)


ValueDescription
data_type(length)Specifies the target data type (with an optional length)
expressionSpecifies the value to be converted
styleSpecifies the output format for the date/time

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home