How do I find the difference between two dates and seconds in SQL?

Minh Phượng

New member
How do I find the difference between two dates and seconds in SQL?
Answer
To calculate the difference between the arrival and the departure in T-SQL, use
the DATEDIFF(datepart, startdate, enddate) function. The datepart argument can be microsecond , second , minute , hour , day , week , month , quarter , or year . Here, you’d like to get the difference in seconds, so choose second.
 

Tìm kiếm

Back
Top