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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 SQL Timing Query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 01/03/2013 :  13:53:38  Show Profile  Reply with Quote


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

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 01/03/2013 :  14:19:59  Show Profile  Reply with Quote
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
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 01/04/2013 :  02:38:21  Show Profile  Reply with Quote
see logic here

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000