Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    4

    Unanswered: Converting string to 'dd/mm/yy' date format.

    Hi,

    Im trying to update a Sybase datetime column with the following string '08/03/2006', ie 8th March 2006.

    update dateTable
    set date = '08/03/2006'

    How do i enforce the 'dd/mm/yy' date format, because at present, the table interprets this as the 'mm/dd/yy' format.

    Thanks!!!

  2. #2
    Join Date
    Feb 2004
    Posts
    88
    Hi,

    look up "SET DATEFORMAT ..." in the manuals.
    This setting tells Sybase how to interpret dates in the form xx/yy/zz

    be aware that the "SET LANGUAGE ..." setting affects the DATEFORMAT setting.
    The default language setting of "us_english" (which you must be inheriting)defaults the "SET DATEFORMAT setting to mdy.

    HTH,

    Bill

  3. #3
    Join Date
    Mar 2006
    Posts
    25

    Cool

    u try to use the following query

    update dateTable
    set date="03/08/2006"

    or

    update dateTable
    set date=convert(datetime,"08/03/2006",103)


    Quote Originally Posted by wooky10
    Hi,

    Im trying to update a Sybase datetime column with the following string '08/03/2006', ie 8th March 2006.

    update dateTable
    set date = '08/03/2006'

    How do i enforce the 'dd/mm/yy' date format, because at present, the table interprets this as the 'mm/dd/yy' format.

    Thanks!!!

Posting Permissions

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