Archives of the TeradataForum
Message Posted: Wed, 15 May 2002 @ 23:46:15 GMT
You need to define the interval type you would like your difference stored as, sort of like a cast. So if you wanted to know the minutes between 2 timestamps you would code:
select (cast ('2002-05-15 00:30:00' as timestamp(0)) - cast ('2002-05-14 22:30:00' as timestamp(0))) minute(4);
You can store the difference as day, hour, min to sec, etc. You just have to specify. See chapter 2 of SQL Reference - Volume 3 for all the available intervals.
If you need the difference in seconds, there is unfortunately not an interval for this. So let me know if you need, I have some sql that can generate this difference for you.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|