Archives of the TeradataForum
Message Posted: Thu, 01 Nov 2001 @ 18:35:25 GMT
As you say, it's not easy given the way Teradata stores times.
One way is to EXTRACT each component of the time fields, subtract the starting time from the ending time and then convert to seconds (or minutes if that's good enough) and then add the results together - i.e. (ending Hour - starting Hour) * 3600 + (ending Minute - starting Minute) * 60 + (ending Second - starting Second).
The change in days is easy to handle, use "(ending Date - starting Date) * 86400" and then add it to the answers from above.
Ward Analytics Ltd: Information in motion (www.ward-analytics.com)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|