Results 1 to 3 of 3

Thread: Inserting date

  1. #1
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    1

    Unanswered: Inserting date

    Hi,

    I am trying to insert a date '15/03/2003 11:55:57' in to a datetime field but get an error can anyone help me. I know you have to convert it but don't know how??????


    Siraj

  2. #2
    Join Date
    Nov 2002
    Posts
    833
    create table data_example (id int not null, dateval datetime not null)
    go

    insert into date_example (id, dateval)
    values (1, "March 15, 2003 11:55AM" )

    go

  3. #3
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524

    Wink

    US convention !


    1> insert into t values('2003/03/15 00:00:22')
    2> go
    (1 row affected)

    1> insert into t values('03/15/2003 00:00:22')
    2> go
    (1 row affected)

    1> insert into t values('15/03/2003 00:00:22')
    2> go
    Msg 247, Level 16, State 1:
    Server 'ASE125', Line 1:
    Arithmetic overflow during implicit conversion of VARCHAR value '15/03/2003 00:00:22' to a DATETIME field .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •