Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2011
    Posts
    47

    Unanswered: how i can use only "date" from datetime data type ?

    how i can use only "date" from datetime data type ?

    because i want only date not time to be display in my application

    how to do that ?

  2. #2
    Join Date
    Oct 2011
    Posts
    29
    Here is a query.

    SELECT CONVERT(VARCHAR(10),GETDATE(),111)

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by navedjobs View Post
    because i want only date not time to be display in my application
    in that case, you should write the necessary application code to display only the date

    this is not a job for sql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    those solutions are fine if you need to use only the date somehow, like to match a particular date value in a column to today's date

    but the original poster was looking for how to display only the date in the application

    i still think this is not a job for sql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Nov 2011
    Posts
    20
    select CONVERT(varchar, getdate() , 101)

  6. #6
    Join Date
    Nov 2011
    Posts
    8

    Question

    Why not use CAST(MyDatetime as Date) instead of converting to a string?

  7. #7
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    In SQL 2008, there is a new date datatype. Why not use that?

Posting Permissions

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