SQL Server - How Do I Substract 2 Hours from Formatted Time

Posted by user1842653 on Stack Overflow See other posts from Stack Overflow or by user1842653
Published on 2012-11-21T16:41:20Z Indexed on 2012/11/21 16:59 UTC
Read the original article Hit count: 130

Filed under:

I need to know how to add 2 hours to the below 'Completed' timestamp.

Here is the Select statement

    Select Tsk.task_id,Tsk.org_id,Tsk.completed,Tsk.assgn_acct_id,name 
    FROM tdstelecom.tasks As Tsk
    WHERE Tsk.task_id = '11094836'
    AND DATE(Tsk.completed) < CURDATE() AND DATE(Tsk.completed) >= DATE_SUB(CURDATE
    (),INTERVAL 180 DAY)

Here are the results: 2012-08-22 14:18:14

Desired results: 2012-08-22 16:18:14

© Stack Overflow or respective owner

Related posts about mysql