Skip to content
Advertisement

Count total days between current day (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.

Advertisement

Answer

You could try to make use of DATEDIFF:

SELECT DATEDIFF(DAY, GETDATE() , DayConfirm) 
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement