sql - retrieve day after tomorrow date query -
i want select day after tomorrow date in sql. want make query select date after 2 days. if select today's date calender(29-04-2015) should show date on other textbox (01-05-2015). want query retrieve day after tomorrow date. far have done in query below:
select value_date dlg_deal value_date = getdate()+2
thanks in advance
note if have date field containing time information, need truncate date part using dateadd
dateadd(d, 0, datediff(d, 0, value_date))
to compare 2 dates ignoring date part use datediff
select value_date dlg_deal datediff(d, value_date, getdate()) = -2
or
select value_date dlg_deal datediff(d, getdate(), value_date) = 2
Comments
Post a Comment