Escolar Documentos
Profissional Documentos
Cultura Documentos
Community
Options
Hi,
Can someone tell me how to extract the tenure between two dates as
years and months using SQL?
thanks HG
0 Kudos Reply
6 REPLIES All forum topics Previous Topic Next Topic
Thanks
0 Kudos Reply
sel
Cast((((('2009-02-01')(date))-(('2008-01-01')(date)))year(4)) As
integer)||'year(s)'||
Cast((((('2009-02-01')(date))-(('2008-01-01')(date)))month(4)) As
integer) mod 12||'month(s)'
0 Kudos Reply
0 Kudos Reply
dnoeth Senior Apprentice 12-15-2011 10:28 AM
Hi Mike,
2 is only "incorrect" for a human being, but "correct" for Standard SQL
:-)
SELECT
DATE'20070131'ASdt1,
DATE'20050701'ASdt2,
((dt1(INT))(dt2(INT)))/10000ASage
Dieter
0 Kudos Reply
0 Kudos Reply
0 Kudos Reply
Teradata Links
Downloads
Community Feedback
The Privacy Policy and Terms of Use for this Teradata website changed eective September 8, 2016.