views:

1628

answers:

2

Hi Guys,

One of my columns type is DateTime (Date Registered). I cannot create a query that filters all the data for eg. All registrations who registered on the 22/10/2008 between 18:00 and 20:00.

Thanks

+6  A: 
SELECT *
FROM YourTable
WHERE DateRegistered BETWEEN '10/22/2008 18:00:00' AND '10/22/2008 20:00:00'

Should do the trick

Mitchel Sellers
Thanks it worked.... :)
David Bonnici
A: 

have you tried using datediff?

http://msdn.microsoft.com/en-us/library/ms189794.aspx

Victor