How do I get the difference between two date fields in terms of hrs:mins:secs?
QUESTION POSED ON: 20 JUL 2005
QUESTION ANSWERED BY: Rudy Limeback
The best strategy is to use the date-handling functions of your specific database system. Every database system has them, and they are all different. Standard SQL does make provisions for date arithmetic of the type that you require, but you will not find these standard functions supported by very many database systems.
My own skills do not cover all possible database systems. I know how to get the difference in hours, minutes and seconds between two datetime values in both MySQL and SQL Server without having to look up the function syntax, but Oracle, PostgresSQL or others, I'd have to read the manual.
|
 |
|