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
 Transact-SQL (2000)
 datetime

Author  Topic 

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-08-02 : 17:28:21
is there a way to do this?

select * from table1
where datefield
>= getdate() 12:00:00AM and
<= getdate() 11:59:00AM

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-02 : 17:51:48
select * from table1
where datefield >= dateadd(day, datediff(day, 0, getdate(), 0)
and datefield < dateadd(day, datediff(day, 0, getdate(), 1)



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-08-02 : 20:42:34
that works.. thanks!
Go to Top of Page
   

- Advertisement -