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

  • Home
  • SEARCH
  • 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 7498111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:20:36+00:00 2026-05-29T19:20:36+00:00

I need all the records from last day? Hi Select * from table1 where

  • 0

I need all the records from last day?

Hi

Select * from table1 where tabledate > getdate() -1 

with this query, i need to run is exactly after midnight to get exact result. I need to run it in day time and get all the previous day’s records.

  • 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-29T19:20:37+00:00Added an answer on May 29, 2026 at 7:20 pm

    In SQL Server 2005, this is generally the fastest way to convert a datetime to a date:

    DATEADD(day, DATEDIFF(day, 0, yourDate), 0)
    

    In your case, it’s done only once, so the how doesn’t really matter much. But it does give the following query.

    Select
      *
    from
      table1
    where
          tabledate >= DATEADD(day, DATEDIFF(day, 0, getDate()) - 1, 0)
      AND tabledate <  DATEADD(day, DATEDIFF(day, 0, getDate()),     0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help with SQL Query. I am trying to select all records
I need to write a simple program that records all the input from parallel
Say I have a query that fetches [type][show_name]. For all [type]==5 records, I need
I've got a reasonably simple query (this time) that I need ALL the results
I need to write a SQL Select statement to select all the records where
I have 2 tables from which i need to run a query to display
i need some help in getting the day value of last 7 days from
Given a table action(start:DATE, length:NUMBER, type:NUMBER), with all records unique, I need to select
I need loging all HTTP request (from any application). I have Delphi 7.0. Anybody
I need to add the ability for users of my software to select records

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.