php - How to calculate date time in one field -


i have table below named transaction_detail

 id_transd | id_trans | id_cust | inputtime           |  1         | 1        | 1       | 2013-04-15 16:55:58 |   2         | 1        | 1       | 2013-05-15 16:55:58 |   3         | 1        | 1       | 2013-06-15 16:55:58 |  4         | 2        | 2       | 2013-06-15 16:55:58 |  

i want amount of inputtime (type : datetime) have same id_cust. i've done date, don't know how calculate time. sql syntax calculate date :

select (date(max(inputtime)) - date (min(inputtime))) total transaction_detail id_cust = '$idp' 

any appreciated. before.

have in website might need. http://www.sqlusa.com/bestpractices/datetimeconversion/


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -