View Full Version : need help in concatenation

28 Mar 2012, 11:53 PM

I need help in concatenation.

here is my code:

SELECT (SUM(TIMESTAMPDIFF(DAY, chemicalweighing_dateEntry, NOW()))), (SUM(TIMESTAMPDIFF(HOUR, chemicalweighing_dateEntry, NOW()))) - (SUM(TIMESTAMPDIFF(DAY,chemicalweighing_dateEntry, NOW())) * 24) AS age_day FROM kanban_data;

the output of this is:

57 204
they are separated in between two columns.

I want to combine them in one column like this:

57 day(s) 204 hr(s) ago

Thank you

29 Mar 2012, 01:25 AM
you must select them one by one or select them as a model. then model.day and model.hr!

Rotary dryer (http://www.china-crusher.com/drier5.html) | Cement plant (http://www.hxjqcrusher.com/Cement-mill.html)| Stone crushing plant (http://www.hxjq-crushers.com/47.htm) | Classifier (http:// www.hxjq-crushers.com/15.htm)