DateTime SQL

Posted on 2006-05-09
Last Modified: 2009-07-29
How to get time in SQL query, I need a time 24 hrs from now.
Question by:karthikram
    LVL 142

    Accepted Solution

    select dateadd(day, -1, getdate())
    LVL 21

    Expert Comment

    select DateAdd( hh, 24, GetDate() )
    LVL 34

    Expert Comment

    by:Brian Crowe
    SELECT DATEADD(day, 1, GetDate())
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    >24 hrs from now.
    My suggestion is 24 hours (1 day) before now... sorry

    Author Comment

    I need for 24 hours before .
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    well, then my first suggest was correct ...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    SQL Query 18 62
    SQL 2014 Availability groups and listeners 5 21
    Date Differences SSRS 3 22
    Poweshell file to remote server 11 17
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now