Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Split the dates bi-weekly - response (1) by bikky6

$
0
0

I have written like this.I feel this is complex.

SEL B.STARTDATE,COALESCE(MAX(STARTDATE) OVER( PARTITION BY 3 ORDER BY STARTDATE ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING)-1,CAST('9999-12-31' AS DATE)) AS DW_EXPR_DT
FROM

(SEL A.DD as STARTDATE, RANK() OVER(ORDER BY DD) RN
FROM
(
SEL DISTINCT
CASE WHEN DAYOFWEEK(CALENDAR_DATE) =2 THEN CALENDAR_DATE
ELSE
CASE WHEN CALENDAR_DATE


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>