Results 1 to 2 of 2

Thread: Date Time conversion

  1. #1
    Jim J. Zhong Guest

    Date Time conversion

    Hi,

    I just had problem with Date Time conversion. Here is the example:

    Select GetDate()

    Result: 2000-08-02 23:50:15.280

    Then I use Convert function:

    Select Convert(DateTime,Cast(GetDate() as varchar), 101)

    Result: 2000-08-02 23:50:00.000

    What I expected to see is: 08/02/2000 and it was what I used to get.


    Can anybody helpe to solve this problem? I am running sql server 7.0



    Thanks,


    Jim

  2. #2
    jkv Guest

    Date Time conversion (reply)

    Hi Jim,
    try this:
    Select Convert(varchar,GetDate(),101)


    ------------
    Jim J. Zhong at 8/3/00 12:43:13 AM

    Hi,

    I just had problem with Date Time conversion. Here is the example:

    Select GetDate()

    Result: 2000-08-02 23:50:15.280

    Then I use Convert function:

    Select Convert(DateTime,Cast(GetDate() as varchar), 101)

    Result: 2000-08-02 23:50:00.000

    What I expected to see is: 08/02/2000 and it was what I used to get.


    Can anybody helpe to solve this problem? I am running sql server 7.0



    Thanks,


    Jim

Posting Permissions

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