I've a slight problem with the datediff() SQL function.
I'd like to get the Years / Months / Days / Hours / Minutes from the calculation...Code:Select DATEDIFF(day, Startdatum, getdate()) AS aantal_dagen, DATEDIFF(Hour, Startdatum, getdate()) AS aantal_uren, DATEDIFF(Minute, Startdatum, getdate()) AS aantal_minuten, DATEDIFF(Month, Startdatum, getdate()) AS aantal_maanden, (DATEDIFF(Minute, Startdatum, getdate()) % 60) as minuutje, ((DATEDIFF(Minute, Startdatum, getdate()) - (DATEDIFF(Minute, Startdatum, getdate()) % 60)) / 60) as uurtje FROM Bla
When I do the DATEDIFF(Minute, Startdatum, getdate()) I only want the real minutes....not like 500...but 8 hours and 20 minutes...




Reply With Quote