Tuesday 15 September 2015

datetime - mysql add column for hour difference between 2 dates -


I have edited a mysql table here:

As you can see there, I

Any hint?

class = "post-less" itemprop = "text">

try this:

  SELECT *, HOUR (TIMEDIFF ( STR_TO_DATE (Arbeitsgine, '% d.% M %% Y% H:% I:% s'), now ())) (select driver, GROUP_CONCAT (if (ACTIONTEXT = 'arbitragein', DATETIME, NULL)) AS 'Projektbeginn' FROM geoImportRoot Group 'ARBITSGIN', GROUP_CONCAT (if (ACTIONTEXT = 'Arbeitsende', DATETIME, NULL)) as 'Arbesende', GROUP_CONCAT (if (ACTIONTEXT = 'PB', DATETIME, NULL) By DRIVERNAME) a;   

Check this

Output:

  | DRIVERNAME | ARBEITSBEGINN | ARBEITSENDE | PROJEKTBEGINN | Hours (TIMEDIFF (STR_TO_DATE (ARBEITSBEGINN, '% D.% M.% Y% H:% I:% S'), now ())) | -------------------------------------------------- -------------------------------------------------- ------------------------------------------------- | Marx, Ronald. 18.06.2013 06:32:09 | (Faucet) | 18.06.2013 06:32:12 | 77 | | Richter, Mario. 18.06.2013 06:42:06 | (Faucet) | 18.06.2013 06:42:09 | 77 | | Winkler, Mario. 18.06.2013 06:48:22 | (Faucet) | (Faucet) | 77 |    

No comments:

Post a Comment