I am completely new to SQL Server and don’t have any idea about it. I tried writing a query similar to oracle and I dont see expected results.
My table has a column whenChanged – sample value is 2011-10-05 21:22:27.0
There are 100k rows in the table and I want the list of rows which got changed in the last 1 day, 1 hour blah.blah.blah.
I wrote a query like select top 10 * from tablename where whenchanged > whenchanged -1.
But dont see what i want
Try this to get all the records that have been changed in the last day:
http://msdn.microsoft.com/en-us/library/ms186819.aspx for the details on the DATEADD function and the other date parts you can specify
EDIT: If you want to get records between 2 dates the something like this will work: