Add Minutes value to a DateTime data by using  SQL

Posted on 2007-08-05
Last Modified: 2008-01-09
  I am writing a SQL procdure which need to only add minutes value in a DateTime data. For example
Day1 = '8/5/2007 12:00pm'
I want to add 90 minutes on it to get Day2 = '8/5/2007 13:30pm'

How can I do that?
Thanks a lot,
Question by:Jinghui Li
    LVL 25

    Assisted Solution

    Which database are you using?  In SQL server, use DATEADD.

    select DATEADD(minutes, 90, '8/5/2007 12:00pm')
    LVL 25

    Accepted Solution

    select DATEADD(minute, 90, '8/5/2007 12:00pm')

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 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

    17 Experts available now in Live!

    Get 1:1 Help Now