Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: convert char to datetime

    declare @mydt varchar(10)

    set @mydt = '10/10/2003'

    declare @newdt datetime

    set @newdt = Convert(datetime, @mydt)

    SELECT CONVERT(varchar(25),getdate(),2)

    SELECT CONVERT(varchar(30),@newdt,109)

    SELECT CONVERT(datetime,@mydt)

    SELECT CONVERT(datetime,'10/10/2003',103)

    SELECT CONVERT(datetime,@mydt,103)

    SELECT CAST(CONVERT(char(10), getdate(), 112) as datetime)

    Test the code above and you'll see that the...

Viewing post 1 (of 1 total)