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
 General SQL Server Forums
 New to SQL Server Administration
 SQL Timing Query

Author  Topic 

ahmedpower
Starting Member

6 Posts

Posted - 2013-01-03 : 13:53:38

HI SQL Team

Please support me to get the data query between particular time as
well the exiting syntax as below

and CTHH.DateTime > DateAdd( mm, DATEDIFF(mm,0,GETDATE()),'1/1/1900')

so please advise how i can use spasific time instead of that above one

Ahmed Soliman

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-01-03 : 14:19:59
for all datetimes on a given day one option is:

and <datetimeColumn> >= '2012-01-03'
and <datetimeColumn> < '2012-01-04'

this relies on an implicit conversion from string to datetime. If you want you can make it an explicit conversion with:

and <datetimeColumn> >= convert(datetime, '2012-01-03')
and <datetimeColumn> < convert(datetime, '2012-01-04')

Be One with the Optimizer
TG
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-04 : 02:38:21
see logic here

http://visakhm.blogspot.in/2012/07/generate-datetime-values-from-integers.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -