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)
 Date compare

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2002-05-28 : 09:01:31
I have a table with a field "DateEntered" of type DateTime.

I need to query for a specific date only with

WHERE (DateEntered = '5/20/2002')

How can I compare the date only portion of DateEntered?

Sam

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-28 : 09:11:59
datediff(dd,dateentered,getdate()) = 0
or dateentered between '5/20/2002 0:00' and '5/20/2002 11:59.59'

(I like the first one better)




<O>
Go to Top of Page
   

- Advertisement -