mysql - day difference between today's date and a specified date in SQL -


how find day difference between today's date , specified date in sql. specified date column(p.subscrpenddate__c) in date time format(12/1/2014 12:00 am). have used below query not works

datediff(day,getdate(), p.subscrpenddate__c)  'subscriptionduedate'  

in mysql, datediff function, takes 2 arguments: end date , start date:

datediff(now(), p.subscrpenddate__c)  'subscriptionduedate' 

according manual:

datediff(expr1, expr2) returns expr1 − expr2 expressed value in days 1 date other.

also, current date , time have use now() instead of getdate.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -