Include days in date calculation

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

By Jesus - January 13, 2015

Awesome, we're moving forward :)

I need a couple more things...

1. Is it possible to have the days_employed field as text using this format (as an example): 1 year, 2 months, 3 days or 2 years, 1 month, 1 day ?

2. Also, I've one extra field on my trabajadores table, that field name its Company, can I filer this results by company? (group by company).

Thanks in advance for your help and support!!! as always, 1st class!!!

Jesus

PS If I want to have this as a PDF, can I buy the Created PDF plugin in order to print this reports in a nice PDF?

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 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