By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

data type datetime ??

P: 17
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.

May 8 '08 #1
Share this Question
Share on Google+
2 Replies

P: 17
i found somthing related to it
May 8 '08 #2

code green
Expert 100+
P: 1,726
This one method.
Expand|Select|Wrap|Line Numbers
You can also use different types from VARCHAR and different codes to change the format
This is a very good article
May 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.