Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count total days between current day (SQL)

Tags:

sql

i'm trying to count the total days between current date and a specific column called "DayConfirm" (datetime). I want to show the total days in a new column beside the rows with "DayChanged" So far i got this:

SELECT DATEDIFF(CURDATE(),(DayConfirm, '%m/%d/%Y') AS DAYS
FROM Administr

can anyone help me? Thank you in advance.

like image 776
user3114347 Avatar asked Oct 20 '22 18:10

user3114347


1 Answers

You could try to make use of DATEDIFF:

SELECT DATEDIFF(DAY, GETDATE() , DayConfirm) 
like image 101
Christos Avatar answered Oct 24 '22 00:10

Christos