SQL-Server 2005 suddenly doesn't accept date format YYYYMMDD

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • YSpa
    New Member
    • Jan 2008
    • 2

    SQL-Server 2005 suddenly doesn't accept date format YYYYMMDD

    Hi,
    I'm using SQL-Server Express 2005 on Windows XP Prof. and after working properly for some time my asp.net application suddenly gave the error that my DateFormat wasn't accepted while using YYYY-MM-DD. Never mind my asp.net application, even in the Management Studio, SQL Server doesn't seem to accept the following query:
    Code:
    SELECT * FROM (table)
    WHERE (table).(date) = '2008-1-30'
    It returns the following error:
    De conversie van char-gegevenstype naar smalldatetime-gegevenstype heeft geresulteerd in een smalldatetime-waarde buiten het bereik. Which translated meens: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated.
    It troubles me a lot because my second workplace (WinXP Prof + SQLServer Express 2005) does seem to accept YYYY-MM-DD. The troubled server had it's language set to Dutch, but I don't believe this to be problem; shouldn't it always accept YYYY-MM-DD. By the way; it does accept DD-MM-YYYY (the standard Dutch/European way of date notation).
    Help or tips would be very welcome.

    Thank you.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Have you made any changes to the system settings in last couple of days ?

    Comment

    • YSpa
      New Member
      • Jan 2008
      • 2

      #3
      Originally posted by debasisdas
      Have you made any changes to the system settings in last couple of days ?
      Not that I know of. But if I had, shouldn't YYYY-MM-DD still function?

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Originally posted by YSpa
        Not that I know of. But if I had, shouldn't YYYY-MM-DD still function?
        that would depend on your server config/setting. if it's set to dutch, i think (read: i don't know heehe) that should be followed...

        -- ck

        Comment

        Working...