Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6657309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:45:06+00:00 2026-05-26T01:45:06+00:00

I am completely new to SQL Server and don’t have any idea about it.

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:45:06+00:00Added an answer on May 26, 2026 at 1:45 am

    Try this to get all the records that have been changed in the last day:

    select top 10 * from tablename where whenchanged > DATEADD (D, -1, GETDATE())
    

    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:

    select * from tablename where whenchanged BETWEEN 'Date1ValueGoesHere' AND 'Date2ValueGoesHere'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have extensive experience working in ASP.NET and Sql Server but I am new
I am a complete SQL Server newbie but I have experience with Oracle and
I am completely confused by MS docs on Windows built-in accounts. SQL Server 2008
I have a piece of code that creates an SQL Server Express 2008 in
I just started using the new project type SQL Server 2008 Database. I can
I have a SQL Server database and I'm using ADO.NET ExecuteReader to get a
I'm working on a rather large classic asp / SQL Server application. A new
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
I am new to SQL Server and currently learning it. I got following stored
I have a SQL Server database and I need to manually do an update

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.