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
Post a Comment