locked
CONVERT() FUNCTION RRS feed

  • Question

  • i want a datetime format as mm/dd/yyyy  in dataset i am getting 
    AcquisitionDate="2005-05-05T00:00:00+05:30"

    if i used convert(datetime,AcquisitionDate) function ,the sql is throwing error  convertion failed to datetime as character string


    any other way to convert this

    guide me please

    Monday, June 19, 2006 11:03 AM

Answers

  • SQL Server's datetime does not store timezone as part of the datetime format.

    To store this data, you can either strip off the time zone portion (using SUBSTRING in sql or Substring in .Net) and store as is. If the timezone is important to you, you can normalize the time with respect to a standard time zone and then strip the timezone off.

    -Todd

     

    Monday, June 19, 2006 9:17 PM