|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I have to calculate time difference using sql statements in MySQL. Can somebody please tell me the syntax for it.
|
|
#2
|
|||
|
|||
|
There are many different time manipulation functions for valid datetime columns - just check on MySQL's online manual.
A personal favorite is the to_days() function.... > select * from table_name > where to_days(now())-to_days(activity_date) > <= 7; // show me all the activities that occurred within the last week. |
|
#3
|
|||
|
|||
|
yaar amit
wht exaclty is ur requirement ? wht time diff u wanna measure? to_days() is always a good option .. give some more details like wht do u want ranjeet walunj |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > time difference |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|