Results 1 to 3 of 3

Thread: using "where date>='2004-01-01 00:00:00.000'

  1. #1
    Join Date
    Mar 2004
    Location
    Cowshill
    Posts
    3

    using "where date>='2004-01-01 00:00:00.000'

    We have a VB client application performing a query similar to the above. On our live SQL 7.0 DB the query returns results. On our test SQL server 2000 Db with the same imported data nothing is returned unless the date is entered in the format '01/01/2004 00:00:00.000'. The same occurs in query analyser running on the SQL server machines themselves. The machine regional settings are the same as is the default language setting on the 2 SQL Servers????
    Any thoughts

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    I always use convert function.

    convert(varchar(10),getdate(),112) >='20040101'

  3. #3
    Join Date
    Mar 2004
    Location
    Cowshill
    Posts
    3
    Problem is that its a big client app (approx 50,000 lines of code) the standard through it all is to use a VB format command such as
    "Format(sDate, "yyyy-mm-dd")" while building the SQL statement string. Are there any default settings on the SQL server to control which date formats are acceptable. (The databases were restored from live onto an SQL 7 server before being upgraded. So most of the settings will be the same?) Is there a way of dumping the hex value the variable is stored as in SQL to compare the 2 servers values? I know the display format depends on the local machine settings. I am wondering if the restore and upgrade has changed the date

Posting Permissions

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