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 2005 Forums
 Transact-SQL (2005)
 Addition in Time Part

Author  Topic 

amit.2601
Starting Member

8 Posts

Posted - 2010-02-04 : 23:39:08
Hi,
I have to fetch data every day between 10 to 10.30 Am in the morning
and i want to create filter in Date so that daily i can fetch Data between this time

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-02-05 : 00:09:19
select * from table_name where datepart(hh,date_time_column)=10
and datepart(MI,date_time_column)<=30

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-05 : 11:02:06
[code]select * from table_name where date_time_column > = dateadd(dd,datediff(dd,0,getdate()),'10:00:00')
and date_time_column < dateadd(dd,datediff(dd,0,getdate()),'10:31:00')[/code]
Go to Top of Page
   

- Advertisement -