data type datetime ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • quadri
    New Member
    • Feb 2008
    • 17

    data type datetime ??

    when executing a query in sql 2005
    select getdate() what you get , suppose

    2008-05-08 12:41:10.587

    Is ther any query where i can get date only and the datatype should be in datatime.
    Is there any datatype only " date " in sql 2005. I heard its in sql 2008 ?
    My exact problem is
    For example ,here startdate datatype is datetime.
    select * from dbo.Emp where startdate between 2008-05-08 and 2008-05-08.
    i am getting 0 rows here.
    what is the best way to select this query.

    hope i explained it clearly.


    TIA
  • quadri
    New Member
    • Feb 2008
    • 17

    #2
    i found somthing related to it

    http://www.sql-server-performance.com/articles/dev/datetime_2008_p 1.aspx

    Comment

    • code green
      Recognized Expert Top Contributor
      • Mar 2007
      • 1726

      #3
      This one method.
      Code:
      SELECT CONVERT(VARCHAR,GETDATE(),103)
      You can also use different types from VARCHAR and different codes to change the format
      This is a very good article

      Comment

      Working...