Archives of the TeradataForum
Message Posted: Sat, 18 Aug 2007 @ 08:40:53 GMT
Right now I am using Teradata SQL Assistant 7.1.0 for my DWH project. I need to write an SQL where the FIS_WK_KEY between the current year of day and next year of days. Here is the following SQL hard-coded days manually.
SELECT DISTINCT A.COL1, B.COL2, C.COL3, FROM TABLE_A A, TABLE_B B, TABLE_C C WHERE A.COL1 = 5 AND B.COL2 = 4 AND (A.COL2 BETWEEN B.PROCESS_DATE - 365 AND B.PROCESS_DATE + 365)
From the above SQL, Want to use date function and instead of hard-coding number of days (-365 & +365) need to use date functions and find out number of days. Please help me.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 15 Jun 2023|