Converting 01.12.2005 into 1-Dec 2009 while insert

  • I have a date like 01.12.2005 in excel sheet. While i make a query and then run this in sql to insert it into a table, it is interpreting it as 12 Jan 2009. i want it to be 12 Jan 2009.

    Please tell me how can i control the insert.

    Pramod

  • pramod_yg (11/4/2009)


    it is interpreting it as 12 Jan 2009. i want it to be 12 Jan 2009.

    Pramod

    both are same right?

    ---------------------------------------------------------------------------------

  • Oops... I want it to be as 1 Dec 2009

    Pramod

  • Select convert(varchar(11),(convert(datetime, '01.12.2005', 104)), 113)

    ---------------------------------------------------------------------------------

  • Thanks a lot nabha. I didnt know that for even datetime convert, we can specify a format

    Thanks once again...

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply