distal-attribute
distal-attribute
distal-attribute
distal-attribute

Trouble using DATEDIFF

User, date Message
Written by geragera
7 years ago
Category: General
1 posts since Thu, 31 Jan 08
Hi everybodyhappy,
i just start using SQL and i have a trouble using DATEDIFF in HeidiSQL. i have one date '2007-12-27' and i trying to obtain how many months and days are of difference between that date and Today(CURRENT_DATE()) i
Written by ansgar
7 years ago
4988 posts since Fri, 07 Apr 06
You could divide the result of DATEDIFF by 30, that would give you a rough result. But I guess you want the exact months and days, as different months have a different number of days. That should be done with some application logic, not SQL.
Written by siMKin
7 years ago
104 posts since Sun, 01 Apr 07
with the command TO_DAYS you can convert the date to an amount of days and substract one from the other in that way, so the result will also be in days
 

Please login to leave a reply, or register at first.