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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -