246: when 'RLY' then
247: begin
248: l_curr_pattern:= 16;
249: l_prev_pattern:= 256;
250: l_current_start_date:=FII_TIME_API.ryr_start(l_current_date);
251: l_prior_date := l_current_date - 365;
252: end;
253:
254: when 'YTD' then
254: when 'YTD' then
255: begin
256: l_curr_pattern:= 131072;
257: l_prev_pattern:= 4194304;
258: l_current_start_date:=FII_TIME_API.ryr_start(l_current_date);
259: l_prior_date := l_current_date - 365;
260: end;
261:
262:
263: when 'RLQ' then
264: begin
265: l_curr_pattern:= 8;
266: l_prev_pattern:= 128;
267: l_current_start_date:=FII_TIME_API.rqtr_start(l_current_date);
268: l_prior_date := l_current_date - 90;
269: end;
270:
271: when 'QTD' then
271: when 'QTD' then
272: begin
273: l_curr_pattern:= 65536;
274: l_prev_pattern:= 2097152;
275: l_current_start_date:=FII_TIME_API.rqtr_start(l_current_date);
276: l_prior_date := l_current_date - 90;
277: end;
278:
279: when 'RLM' then
279: when 'RLM' then
280: begin
281: l_curr_pattern:= 4;
282: l_prev_pattern:= 64;
283: l_current_start_date:=FII_TIME_API.rmth_start(l_current_date);
284: l_prior_date := l_current_date - 30;
285: end;
286:
287: when 'MTD' then
287: when 'MTD' then
288: begin
289: l_curr_pattern:= 32768;
290: l_prev_pattern:= 1048576;
291: l_current_start_date:=FII_TIME_API.rmth_start(l_current_date);
292: l_prior_date := l_current_date - 30;
293: end;
294:
295: when 'RLW' then
295: when 'RLW' then
296: begin
297: l_curr_pattern:= 2;
298: l_prev_pattern:= 32;
299: l_current_start_date:=FII_TIME_API.rwk_start(l_current_date);
300: l_prior_date := l_current_date - 7;
301: end;
302:
303: when 'WTD' then
303: when 'WTD' then
304: begin
305: l_curr_pattern:= 16384;
306: l_prev_pattern:= 524288;
307: l_current_start_date:=FII_TIME_API.rwk_start(l_current_date);
308: l_prior_date := l_current_date - 7;
309: end;
310:
311: when 'DAY' then
324: begin
325: l_lag:= 1;
326: l_curr_pattern:= 16;
327: l_prev_pattern:= 4096;
328: l_current_start_date:=FII_TIME_API.ryr_start(l_current_date);
329: end;
330:
331: when 'YTD' then
332: begin
332: begin
333: l_lag:= 1;
334: l_curr_pattern:= 131072;
335: l_prev_pattern:= 134217728;
336: l_current_start_date:=FII_TIME_API.ryr_start(l_current_date);
337: end;
338:
339:
340: when 'RLQ' then
341: begin
342: l_lag:= 8;
343: l_curr_pattern:= 8;
344: l_prev_pattern:= 2048;
345: l_current_start_date:=FII_TIME_API.rqtr_start(l_current_date);
346: end;
347:
348: when 'QTD' then
349: begin
349: begin
350: l_lag:= 8;
351: l_curr_pattern:= 65536;
352: l_prev_pattern:= 67108864;
353: l_current_start_date:=FII_TIME_API.rqtr_start(l_current_date);
354: end;
355:
356: when 'RLM' then
357: begin
357: begin
358: l_lag:= 12;
359: l_curr_pattern:= 4;
360: l_prev_pattern:= 1024;
361: l_current_start_date:=FII_TIME_API.rmth_start(l_current_date);
362: end;
363:
364: when 'MTD' then
365: begin
365: begin
366: l_lag:= 12;
367: l_curr_pattern:= 32768;
368: l_prev_pattern:= 33554432;
369: l_current_start_date:=FII_TIME_API.rmth_start(l_current_date);
370: end;
371:
372: when 'RLW' then
373: begin
373: begin
374: l_lag:= 13;
375: l_curr_pattern:= 2;
376: l_prev_pattern:= 512;
377: l_current_start_date:=FII_TIME_API.rwk_start(l_current_date);
378: end;
379:
380: when 'WTD' then
381: begin
381: begin
382: l_lag:= 13;
383: l_curr_pattern:= 16384;
384: l_prev_pattern:= 16777216;
385: l_current_start_date:=FII_TIME_API.rwk_start(l_current_date);
386: end;
387:
388: when 'DAY' then
389: begin
1273: WHERE as_of_date BETWEEN start_date AND end_date;
1274:
1275: IF (l_curr_qtr = 4)
1276: THEN
1277: l_date := fii_time_api.ent_cyr_start (as_of_date);
1278: ELSE
1279: SELECT start_date
1280: INTO l_date
1281: FROM fii_time_ent_qtr