Results 1 to 6 of 6

Thread: SQL date shows as string not date

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Location
    Nuneaton
    Posts
    291
    Thanks
    8
    Thanked
    5 times in 5 posts
    • Re-Invented's system
      • Motherboard:
      • Asus P5W Deluxe
      • CPU:
      • Core 2 Duo E6600
      • Memory:
      • 2x1 GB Geil 6400
      • Storage:
      • 2x 320 Seagate Drives SATA
      • PSU:
      • 700w FSP Epsilon
      • Case:
      • Silverstone TJ0?
      • Operating System:
      • Vista Ultimate
      • Monitor(s):
      • 43" Pioneer 436XDE
      • Internet:
      • Be There 24mb

    SQL date shows as string not date

    Hi all,

    We have just set up an sql data server that takes all the data off our live server(aix box) so reporting can be done without affecting the main server.

    It drops the tables, re creates them and imports data via odbc which all works great.

    The only problem is when you link to a table say in access or crystal reporter it shows a date column as a string yet its clearly defined as a date column on the sql server?? if i change this to datetime it shows as datetime.

    If i link to live data it shows as date in crystal reports??

    If anyone has any ideas, that would be great.

    Thanks
    Lee
    Last edited by Re-Invented; 06-10-2009 at 11:27 AM.

  2. #2
    Senior Member
    Join Date
    Sep 2009
    Posts
    542
    Thanks
    10
    Thanked
    12 times in 12 posts

    Re: SQL date shows as string not date

    do you think it could be something to do with the date format, e.g. dd/mm/yyyy

  3. #3
    Senior Member
    Join Date
    Jul 2003
    Location
    Nuneaton
    Posts
    291
    Thanks
    8
    Thanked
    5 times in 5 posts
    • Re-Invented's system
      • Motherboard:
      • Asus P5W Deluxe
      • CPU:
      • Core 2 Duo E6600
      • Memory:
      • 2x1 GB Geil 6400
      • Storage:
      • 2x 320 Seagate Drives SATA
      • PSU:
      • 700w FSP Epsilon
      • Case:
      • Silverstone TJ0?
      • Operating System:
      • Vista Ultimate
      • Monitor(s):
      • 43" Pioneer 436XDE
      • Internet:
      • Be There 24mb

    Re: SQL date shows as string not date

    How would i define this in sql then ??

    Thanks
    Lee

  4. #4
    Anthropomorphic Personification shaithis's Avatar
    Join Date
    Apr 2004
    Location
    The Last Aerie
    Posts
    10,857
    Thanks
    645
    Thanked
    872 times in 736 posts
    • shaithis's system
      • Motherboard:
      • Asus P8Z77 WS
      • CPU:
      • i7 3770k @ 4.5GHz
      • Memory:
      • 32GB HyperX 1866
      • Storage:
      • Lots!
      • Graphics card(s):
      • Sapphire Fury X
      • PSU:
      • Corsair HX850
      • Case:
      • Corsair 600T (White)
      • Operating System:
      • Windows 10 x64
      • Monitor(s):
      • 2 x Dell 3007
      • Internet:
      • Zen 80Mb Fibre

    Re: SQL date shows as string not date

    You cannot force SQL Server to save dates differently.....it's all about how they are read back out.

    Therefore, if you need to force Access or Crystal to datetime for them to appear as datetime, then that is what you need to do.

    The default datetime format is determined by the language setting on the login you are using to access SQL Server.
    Main PC: Asus Rampage IV Extreme / 3960X@4.5GHz / Antec H1200 Pro / 32GB DDR3-1866 Quad Channel / Sapphire Fury X / Areca 1680 / 850W EVGA SuperNOVA Gold 2 / Corsair 600T / 2x Dell 3007 / 4 x 250GB SSD + 2 x 80GB SSD / 4 x 1TB HDD (RAID 10) / Windows 10 Pro, Yosemite & Ubuntu
    HTPC: AsRock Z77 Pro 4 / 3770K@4.2GHz / 24GB / GTX 1080 / SST-LC20 / Antec TP-550 / Hisense 65k5510 4K TV / HTC Vive / 2 x 240GB SSD + 12TB HDD Space / Race Seat / Logitech G29 / Win 10 Pro
    HTPC2: Asus AM1I-A / 5150 / 4GB / Corsair Force 3 240GB / Silverstone SST-ML05B + ST30SF / Samsung UE60H6200 TV / Windows 10 Pro
    Spare/Loaner: Gigabyte EX58-UD5 / i950 / 12GB / HD7870 / Corsair 300R / Silverpower 700W modular
    NAS 1: HP N40L / 12GB ECC RAM / 2 x 3TB Arrays || NAS 2: Dell PowerEdge T110 II / 24GB ECC RAM / 2 x 3TB Hybrid arrays || Network:Buffalo WZR-1166DHP w/DD-WRT + HP ProCurve 1800-24G
    Laptop: Dell Precision 5510 Printer: HP CP1515n || Phone: Huawei P30 || Other: Samsung Galaxy Tab 4 Pro 10.1 CM14 / Playstation 4 + G29 + 2TB Hybrid drive

  5. Received thanks from:

    Re-Invented (07-10-2009)

  6. #5
    Senior Member
    Join Date
    Sep 2009
    Posts
    542
    Thanks
    10
    Thanked
    12 times in 12 posts

    Re: SQL date shows as string not date

    http://www.sql-server-helper.com/tips/date-formats.aspx

    check out what date format is supported with access or what ever you need it for and use the above method(s) accordingly

  7. Received thanks from:

    Re-Invented (07-10-2009)

  8. #6
    Senior Member
    Join Date
    Jul 2003
    Location
    Nuneaton
    Posts
    291
    Thanks
    8
    Thanked
    5 times in 5 posts
    • Re-Invented's system
      • Motherboard:
      • Asus P5W Deluxe
      • CPU:
      • Core 2 Duo E6600
      • Memory:
      • 2x1 GB Geil 6400
      • Storage:
      • 2x 320 Seagate Drives SATA
      • PSU:
      • 700w FSP Epsilon
      • Case:
      • Silverstone TJ0?
      • Operating System:
      • Vista Ultimate
      • Monitor(s):
      • 43" Pioneer 436XDE
      • Internet:
      • Be There 24mb

    Re: SQL date shows as string not date

    Thanks guys will just stay how it is then.

    Thanks
    Lee

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. The Well Dodgy Joke Thread
    By 0iD in forum General Discussion
    Replies: 1246
    Last Post: 08-04-2009, 01:42 PM
  2. Replies: 17
    Last Post: 15-07-2007, 03:59 PM
  3. Mouse with a life of it's own.
    By firefox in forum PC Hardware and Components
    Replies: 10
    Last Post: 23-03-2006, 12:49 PM
  4. SQL Server Connection string?
    By Stoo in forum Software
    Replies: 7
    Last Post: 04-05-2005, 05:48 PM
  5. Zakky - Thanks for the string dude :)
    By Tumble in forum General Discussion
    Replies: 3
    Last Post: 03-06-2004, 03:01 PM

Posting Permissions

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