Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    14

    Unanswered: How to strip time of from a date field

    I have a date field, which has data like 3/31/2011 12:00:00.000 AM, and i need to strip the time off and just get the date. I would like to have it in a query and need to know if i can do this without using datepart.

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Use the convert function e.g.
    select convert(date,getdate())
    select convert(char(10),getdate(),101)

  3. #3
    Join Date
    Apr 2011
    Posts
    3

    Thumbs up

    Use

    select convert(char(10),'31/03/2011',103)

Posting Permissions

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