how to convert an integer to days months years
-
how to convert an integer to days months years i have a number of days resulted from sum of datediff to many rows as integer i want to convert this days into days months years like this pr start end days_diff ------------------------------------------------------- 237 2010-06-01 2010-11-30 182 237 2010-12-01 2011-05-31 181 237 2011-06-01 2012-05-31 365 237 2012-06-01 2013-05-31 364 237 2013-06-01 2014-05-31 364 this total a 1456 days i want to convert this days into 4 years 0 months 1 days when i use the regular sum for each record into days months years it creates 3 years 12 months 1 days or any way that produce the same result even not by calculate the sum of the days difference but produce the same result 4 years 0 months 1 days not 3 years 12 months 1 days thanks for help Lost & Forgotten
-
how to convert an integer to days months years i have a number of days resulted from sum of datediff to many rows as integer i want to convert this days into days months years like this pr start end days_diff ------------------------------------------------------- 237 2010-06-01 2010-11-30 182 237 2010-12-01 2011-05-31 181 237 2011-06-01 2012-05-31 365 237 2012-06-01 2013-05-31 364 237 2013-06-01 2014-05-31 364 this total a 1456 days i want to convert this days into 4 years 0 months 1 days when i use the regular sum for each record into days months years it creates 3 years 12 months 1 days or any way that produce the same result even not by calculate the sum of the days difference but produce the same result 4 years 0 months 1 days not 3 years 12 months 1 days thanks for help Lost & Forgotten
I didn't got, how you compute the years, months and days?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
-
how to convert an integer to days months years i have a number of days resulted from sum of datediff to many rows as integer i want to convert this days into days months years like this pr start end days_diff ------------------------------------------------------- 237 2010-06-01 2010-11-30 182 237 2010-12-01 2011-05-31 181 237 2011-06-01 2012-05-31 365 237 2012-06-01 2013-05-31 364 237 2013-06-01 2014-05-31 364 this total a 1456 days i want to convert this days into 4 years 0 months 1 days when i use the regular sum for each record into days months years it creates 3 years 12 months 1 days or any way that produce the same result even not by calculate the sum of the days difference but produce the same result 4 years 0 months 1 days not 3 years 12 months 1 days thanks for help Lost & Forgotten
-
how to convert an integer to days months years i have a number of days resulted from sum of datediff to many rows as integer i want to convert this days into days months years like this pr start end days_diff ------------------------------------------------------- 237 2010-06-01 2010-11-30 182 237 2010-12-01 2011-05-31 181 237 2011-06-01 2012-05-31 365 237 2012-06-01 2013-05-31 364 237 2013-06-01 2014-05-31 364 this total a 1456 days i want to convert this days into 4 years 0 months 1 days when i use the regular sum for each record into days months years it creates 3 years 12 months 1 days or any way that produce the same result even not by calculate the sum of the days difference but produce the same result 4 years 0 months 1 days not 3 years 12 months 1 days thanks for help Lost & Forgotten
You'll need to pick a starting date, since different months have a different number of days. For example, 30 days from 1st March would be 30 days; from 1st April, it would be one month; from 1st February 2014, it would be one month and two days; from 1st February 2012, it would be one month and one day.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I didn't got, how you compute the years, months and days?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
start end ------------------------------------------------------- 2010-06-01 2010-11-30 2010-12-01 2011-05-31 2011-06-01 2012-05-31 2012-06-01 2013-05-31 2013-06-01 2014-05-31 suppose this an experience periods i want to get total of this experience thanks for help Lost & Forgotten
-
How do you do the calculation? If the number of months comes out at 12 then that is 1 year.
start end ------------------------------------------------------- 2010-06-01 2010-11-30 2010-12-01 2011-05-31 2011-06-01 2012-05-31 2012-06-01 2013-05-31 2013-06-01 2014-05-31 suppose this an experience periods i want to get total of this experience thanks for help Lost & Forgotten
-
start end ------------------------------------------------------- 2010-06-01 2010-11-30 2010-12-01 2011-05-31 2011-06-01 2012-05-31 2012-06-01 2013-05-31 2013-06-01 2014-05-31 suppose this an experience periods i want to get total of this experience thanks for help Lost & Forgotten
OK... Get minimum of start (select min(start) from ... where ...) Get maximum of end (select max(end) from ... where ...) Do datediff between the two...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
-
OK... Get minimum of start (select min(start) from ... where ...) Get maximum of end (select max(end) from ... where ...) Do datediff between the two...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
thats right in case the periods are connected some cases the periods not connected like start end ----------------------------- 2010-06-01 2010-11-30 2011-06-01 2012-05-31 2013-06-01 2014-05-31 Lost & Forgotten
-
start end ------------------------------------------------------- 2010-06-01 2010-11-30 2010-12-01 2011-05-31 2011-06-01 2012-05-31 2012-06-01 2013-05-31 2013-06-01 2014-05-31 suppose this an experience periods i want to get total of this experience thanks for help Lost & Forgotten
-
thats right in case the periods are connected some cases the periods not connected like start end ----------------------------- 2010-06-01 2010-11-30 2011-06-01 2012-05-31 2013-06-01 2014-05-31 Lost & Forgotten
I see... In that case you can do something like this select sum(datediff(d, start,end)) from ... where ...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)