Loading ...
Sorry, an error occurred while loading the content.

Re: MUGH-SQLCON date time format

Expand Messages
  • virender jain
    Hi Aneesh Thanks a lot for sharing you knowledge.... Regards Virender Jain aneesh wrote: SQL server always displays the date in the
    Message 1 of 3 , Aug 31, 2006
    • 0 Attachment
      Hi Aneesh
      Thanks a lot for sharing you knowledge....


      Regards
      Virender Jain

      aneesh <aneeshattingal@...> wrote:
      SQL server always displays the date in the form of
      'YYYY-MM-DD mm: ..... '.
      Now about the second part , Your query returns you the
      date format as 'mdy', this means, sql server will
      treat the date you are giving in the format MDY.

      so if you are inputting the date as '07-08-2006', it
      can be the either Aug 07 or July 08. if the
      dateformat is mdy, the first numeric part will be
      taken as Month.

      If you specify the dates like '2006-08-09' or
      '20060809' , sql server won't go for the above
      formats.

      declare @date datetime
      SET @Date = '07-08-2006'
      SELECT @Date
      SELECT CONVERT(varchar(11),@date,100)

      --- virender jain <virender_jain77@...> wrote:

      > select name ,alias, dateformat
      > from syslanguages
      > where langid =
      > (select value from master..sysconfigures
      > where comment = 'default language')
      >
      > Result is
      > name alias format
      > us_english English mdy
      >
      >
      > but when i am checking in any table e..g
      > sysobjects
      >
      > select crdate from sysobjects it is showing
      > result in yy mm dd format.
      >
      > 2000-08-06 01:29:12.500
      >
      > but as per the first query for in mdy so result
      > should be like 08-06-2000 01:29:12.500...
      >
      >
      > Please it is quite serious issue for me... next i
      > might need to change the database level date format
      > for a production database....as per application
      > teams wants.....is it really feasible or should i
      > have to ask them to make changes in queries....
      >
      >
      > Please answer to all
      > Viru
      >
      >
      > ---------------------------------
      > Do you Yahoo!?
      > Everyone is raving about the all-new Yahoo! Mail.
      >
      > [Non-text portions of this message have been
      > removed]
      >
      >

      Aneesh R.

      Expert Exchange.com Genius SQL server
      http://sequelserver.blogspot.com/
      http://www.sqlknowledge.com


      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com





      ---------------------------------
      Stay in the know. Pulse on the new Yahoo.com. Check it out.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.