Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    7

    Question Unanswered: how to format the date data type input in DD-MM-YY

    hi all , does SQL server able to input the date that is originally from 2/6/2004 11:07:46 AM to DD-MM-YY 06-02-04 and store in the DB. For example , this is the SQL insert query

    INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,'2/6/2004 11:07:46 AM')

    the date will automatically converted to 06-02-04 and store in DB .

    Does it need to use SQL Rule or user-defined data type.

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: how to format the date data type input in DD-MM-YY

    Originally posted by verybrightstar
    hi all , does SQL server able to input the date that is originally from 2/6/2004 11:07:46 AM to DD-MM-YY 06-02-04 and store in the DB. For example , this is the SQL insert query

    INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,'2/6/2004 11:07:46 AM')

    the date will automatically converted to 06-02-04 and store in DB .

    Does it need to use SQL Rule or user-defined data type.
    INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,convert(varchar,'2/6/2004 11:07:46 AM',105))
    Last edited by harshal_in; 03-04-04 at 02:50.

Posting Permissions

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