Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Can I do this any better?

Author  Topic 

elebetsamer
Starting Member

12 Posts

Posted - 2001-05-04 : 02:12:54
The one problem that I have with SQL Server's datetime datatype is this. It stores the date and time. So when you do a query like this "select * from table where datefield = '05/01/2001'" it won't return all the data from that day. Am I missing something simple here. I have seen this done "select * from table where datefield between '05/01/2001' and '05/01/2001 11:59 PM'". I usually do it like this "select * from table where convert(varchar(10), datefield, 101) = '05/01/2001'". Am I doing this in the best way? Thanks.



Edited by - elebetsamer on 05/04/2001 02:13:36
   

- Advertisement -