php - MySQL Query Help - DATEDIFF and Writing Results to A New Column -
OK, I have an unpleasant problem to solve and I've been stumped.
I have a MySQL table essentially
id Tronsdet Startdet ended Unit 1 Unit 1 Product Unit 2 Unit 2 Pross 1 2014-07-31 2014- with this structure 10-25 2014-10-29 22 hits 25.00 27 25.00 I need to do is make another column which Kuldin which calculates the number of days between Startdet and ended.
How do I do this?
Thank you very much
- Create columns
< Change the code> table YourTableName column add daysdiff int; - Update the new column with the appropriate calculations
update YourTableName set daysdiff = datediff (enddate, startdate);
Comments
Post a Comment