Results 1 to 2 of 2

Thread: Dates ...

  1. #1
    Join Date
    Nov 2002
    Location
    cornwall
    Posts
    187

    Dates ...

    why does this sql return the dates in different formats? Is it a default setting on the server or do i just handle it on SQL?

    use northwind

    select top 20 orderdate from orders

    select top 20 left(orderdate,10) from orders


    thanks

    fatherjack

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    When you used LEFT function SQL did implicity conversion of date to character.


    select top 20 cast(orderdate as varchar) from orders

    will show the same effect.

Posting Permissions

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