sql server 2008 - How to subtract today's date (current date) from delivery date SQL Query? -


i have table has current date , delivery date. want minus due date current date , want save days left in dbtable

select clientid,         curentdate,         deliverydate datediff(day,-(deliverydate) current_timestamp) days_left  dbo.tblorder 

e.g:

  • today date 12/1/2014
  • delivery date 20/1/2014
  • days left 8

did in the documentation examples on how use datediff?

select clientid, currentdate, deliverydate,    days_left = datediff(day, current_timestamp, deliverydate)  dbo.tblorder; 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -