Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Location
    Schaumburg, IL
    Posts
    28

    Unanswered: Cast Question - Converting Datetime into Date

    Hi guys,
    I knew that the Function Cast can do this but I tried a lot and I dont want to use the MONTH, YEAR, DAY function.

    I have a smalldatetime field with a value of this 12/18/2004 4:02:00 PM
    I just like to see it like this 12/18/2004

    Hope you can help me up. Thanks.
    -vince

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT CONVERT(varchar(10),GetDate(),101)


    Got Books Online (BOL)?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jan 2003
    Location
    Atlanta
    Posts
    134

    Try this

    declare @val datetime
    set @val='12/18/2005 11:00:00'
    select @val, convert(char(10),@val,101)

  4. #4
    Join Date
    Sep 2005
    Location
    Schaumburg, IL
    Posts
    28
    Quote Originally Posted by Brett Kaiser
    SELECT CONVERT(varchar(10),GetDate(),101)


    Got Books Online (BOL)?
    I have it here.. Thanks a lot....Sometimes, when you have a lot of things in your mind, you cant see exactly the answer which is sometimes in your face already.

    hehehe

Posting Permissions

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