Include days in date calculation

15 posts by 2 authors in: Forums > CMS Builder
Last Post: January 13, 2015   (RSS)

By claire - January 13, 2015

It's possible to do this in MySQL, but it's very difficult. See this Stackoverflow post: http://stackoverflow.com/questions/10765995/convert-days-to-years-months-days-in-mysql

I think a better option for you would be to export this to Excel, for example, and use Excel to turn it into the format you want. You can then also save it as a PDF from Excel, if I recall correctly.

You can change it to group by company and then employer - try a few different combinations and you'll see how it works. The GROUP BY just needs a comma separated list of fields.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - January 13, 2015

Great and how about having the total days as: 

1 year, 2 months, 1 day

or

2 years, 1 month, 3 days

etc?

Please note the extra (s) for plural names (year(s), month(s) or day(s))

Thanks!

By claire - January 13, 2015

Sorry, that's what I mean - it's possible to do this kind of date calculation in MySQL, but it's very tricky. Again, see http://stackoverflow.com/questions/10765995/convert-days-to-years-months-days-in-mysql

It would be easier to export this to a spreadsheet and use that to do the extra formatting and saving as a PDF.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - January 13, 2015

Oh, I think you mention the excel part because of my question for the PDF builder, sorry for the confusion.

I'm looking at the link you sent me right now. Lets see how it goes... Thanks