|
Archives of the TeradataForumMessage Posted: Fri, 06 Mar 2009 @ 16:09:20 GMT
<-- Anonymously Posted: Fri, 6 Mar 2009 16:57 --> Hi All I'm struggling (once more) with date and time functions in Teradata: This time I'd like to know which part of the year is already over. The following query: select (date-cast(extract(year from date) || '-01-01' as date)) / 365.00000 works fine, but it's not so easy to understand and it's not correct for leap years (divison by 366) Browsing the Teradata-Forum I found this code: sel date (format 'ddd')(char(3)); which would be perfect for my task, unfortunately it's not possible to calculate with it (divison by 365 is not possible). Thanks for your help.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||