DBA Data[Home] [Help]

APPS.BEN_EXT_UTIL dependencies on DUAL

Line 1596: into l_rslt_dt from dual ;

1592: elsif p_ext_date_cd = 'PM' then
1593: -- Perivious Monday
1594: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -2)
1595: -decode(greatest((to_number(to_char(p_abs_date,'D')) -2),0.99) ,0.99,7,0))
1596: into l_rslt_dt from dual ;
1597:
1598: elsif p_ext_date_cd = 'PT' then
1599: -- Perious Tuesday
1600: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)

Line 1602: into l_rslt_dt from dual ;

1598: elsif p_ext_date_cd = 'PT' then
1599: -- Perious Tuesday
1600: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)
1601: -decode(greatest((to_number(to_char(p_abs_date,'D')) -3),0.99) ,0.99,7,0))
1602: into l_rslt_dt from dual ;
1603: elsif p_ext_date_cd = 'PW' then
1604: -- Perivious Wednesday
1605: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1606: -decode(greatest((to_number(to_char(p_abs_date,'D')) -4),0.99) ,0.99,7,0))

Line 1607: into l_rslt_dt from dual ;

1603: elsif p_ext_date_cd = 'PW' then
1604: -- Perivious Wednesday
1605: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1606: -decode(greatest((to_number(to_char(p_abs_date,'D')) -4),0.99) ,0.99,7,0))
1607: into l_rslt_dt from dual ;
1608:
1609: elsif p_ext_date_cd = 'PTH' then
1610: -- Perivious THURSDAY
1611: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)

Line 1613: into l_rslt_dt from dual ;

1609: elsif p_ext_date_cd = 'PTH' then
1610: -- Perivious THURSDAY
1611: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)
1612: -decode(greatest((to_number(to_char(p_abs_date,'D')) -5),0.99) ,0.99,7,0))
1613: into l_rslt_dt from dual ;
1614:
1615: elsif p_ext_date_cd = 'PF' then
1616: -- Perivious FRIDAY
1617: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)

Line 1619: into l_rslt_dt from dual ;

1615: elsif p_ext_date_cd = 'PF' then
1616: -- Perivious FRIDAY
1617: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)
1618: -decode(greatest((to_number(to_char(p_abs_date,'D')) -6),0.99) ,0.99,7,0))
1619: into l_rslt_dt from dual ;
1620:
1621: elsif p_ext_date_cd = 'PSA' then
1622: -- Perivious SATURDAY
1623: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)

Line 1625: into l_rslt_dt from dual ;

1621: elsif p_ext_date_cd = 'PSA' then
1622: -- Perivious SATURDAY
1623: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)
1624: -decode(greatest((to_number(to_char(p_abs_date,'D')) -7),0.99) ,0.99,7,0))
1625: into l_rslt_dt from dual ;
1626:
1627: elsif p_ext_date_cd = 'PSU' then
1628: -- Perivious SUNDAY
1629: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -8)

Line 1631: into l_rslt_dt from dual ;

1627: elsif p_ext_date_cd = 'PSU' then
1628: -- Perivious SUNDAY
1629: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -8)
1630: -decode(greatest((to_number(to_char(p_abs_date,'D')) -8),0.99) ,0.99,7,0))
1631: into l_rslt_dt from dual ;
1632: --RCHASE - Bug 1550072 - Add new date calc codes
1633: -- tilak changed the sysdate to p_abs_date
1634: --added Next day - NM, NT, NW, NTH, NF, NSA, NSU
1635: --added Day of next week - MONW, TONW, WONW, THONW, FONW, SAONW, SUONW

Line 1643: into l_rslt_dt from dual;

1639: elsif p_ext_date_cd = 'NM' then
1640: -- Next Monday
1641: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -2)
1642: +decode(greatest(2-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1643: into l_rslt_dt from dual;
1644: elsif p_ext_date_cd = 'NT' then
1645: -- Next Tuesday
1646: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)
1647: +decode(greatest(3-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1648: into l_rslt_dt from dual;

1644: elsif p_ext_date_cd = 'NT' then
1645: -- Next Tuesday
1646: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)
1647: +decode(greatest(3-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1648: into l_rslt_dt from dual;
1649: elsif p_ext_date_cd = 'NW' then
1650: -- Next Wednesday
1651: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1652: +decode(greatest(4-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1653: into l_rslt_dt from dual;

1649: elsif p_ext_date_cd = 'NW' then
1650: -- Next Wednesday
1651: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1652: +decode(greatest(4-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1653: into l_rslt_dt from dual;
1654: elsif p_ext_date_cd = 'NTH' then
1655: -- Next THURSDAY
1656: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)
1657: +decode(greatest(5-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1658: into l_rslt_dt from dual;

1654: elsif p_ext_date_cd = 'NTH' then
1655: -- Next THURSDAY
1656: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)
1657: +decode(greatest(5-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1658: into l_rslt_dt from dual;
1659: elsif p_ext_date_cd = 'NF' then
1660: -- Next FRIDAY
1661: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)
1662: +decode(greatest(6-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1663: into l_rslt_dt from dual;

1659: elsif p_ext_date_cd = 'NF' then
1660: -- Next FRIDAY
1661: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)
1662: +decode(greatest(6-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1663: into l_rslt_dt from dual;
1664: elsif p_ext_date_cd = 'NSA' then
1665: -- Next SATURDAY
1666: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)
1667: +decode(greatest(7-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1668: into l_rslt_dt from dual;

1664: elsif p_ext_date_cd = 'NSA' then
1665: -- Next SATURDAY
1666: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)
1667: +decode(greatest(7-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1668: into l_rslt_dt from dual;
1669: elsif p_ext_date_cd = 'NSU' then
1670: -- Next SUNDAY
1671: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -1)
1672: +decode(greatest(1-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))

Line 1673: into l_rslt_dt from dual;

1669: elsif p_ext_date_cd = 'NSU' then
1670: -- Next SUNDAY
1671: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -1)
1672: +decode(greatest(1-(to_number(to_char(p_abs_date,'D'))),0.99) ,0.99,7,0))
1673: into l_rslt_dt from dual;
1674: elsif p_ext_date_cd = 'MONW' then
1675: -- Monday of next week
1676: l_rslt_dt := trunc(p_abs_date+(2 -to_number(to_char(p_abs_date,'D'))+7));
1677: elsif p_ext_date_cd = 'TONW' then

Line 1733: into l_rslt_dt from dual;

1729: -- if i am on feb 29 the perious period is feb 1- 15 o return feb 1
1730: select trunc(trunc(p_abs_date-15,'MM')
1731: +decode(greatest(to_number(to_char(p_abs_date,'DD')),15.9) , 15.9 , 15,0 )
1732: )
1733: into l_rslt_dt from dual;
1734:
1735: elsif p_ext_date_cd = 'FCSMS1R16' then
1736: -- First of current Semi Month Starting 1st or 16th of Month
1737: -- Tilak :is should go to the current semi period and pick up the firs date of the period

Line 1741: into l_rslt_dt from dual;

1737: -- Tilak :is should go to the current semi period and pick up the firs date of the period
1738: select trunc(trunc(p_abs_date,'MM')
1739: +decode(greatest(to_number(to_char(p_abs_date,'DD')),15.9) , 15.9 , 0,15 )
1740: )
1741: into l_rslt_dt from dual;
1742:
1743: elsif p_ext_date_cd = 'LPSME15RL' then
1744: -- Last of Prior Semi Month Ending 15th or Last of Month (Previous 15th or Last Day of Month)
1745: -- like FPSMS1R16 it has to pikcup the last date of the previous semi month

Line 1747: into l_rslt_dt from dual;

1743: elsif p_ext_date_cd = 'LPSME15RL' then
1744: -- Last of Prior Semi Month Ending 15th or Last of Month (Previous 15th or Last Day of Month)
1745: -- like FPSMS1R16 it has to pikcup the last date of the previous semi month
1746: select trunc(p_abs_date,'MM')+decode(greatest(to_number(to_char(p_abs_date,'DD')),15),15, -1, 14)
1747: into l_rslt_dt from dual;
1748:
1749: elsif p_ext_date_cd = 'LCSME15RL' then
1750: -- Last of current Semi Month Ending 15th or Last of Month
1751: -- like FCSMS1R16 it has to pikcup the last date of the previous semi month

Line 1754: into l_rslt_dt from dual;

1750: -- Last of current Semi Month Ending 15th or Last of Month
1751: -- like FCSMS1R16 it has to pikcup the last date of the previous semi month
1752: select decode(greatest(to_number(to_char(p_abs_date,'DD')),15),15,
1753: trunc(p_abs_date,'MM') +14 , trunc(add_months(p_abs_date,1),'MM') -1)
1754: into l_rslt_dt from dual;
1755:
1756:
1757: elsif p_ext_date_cd = 'CM16' then
1758: -- 16th of current month

Line 1772: into l_rslt_dt from dual ;

1768: elsif p_ext_date_cd = 'MOPW' then
1769: -- Perivious monday previous
1770: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -2)
1771: -decode(greatest((to_number(to_char(p_abs_date,'D')) -2),0.99) ,0.99,14,7))
1772: into l_rslt_dt from dual ;
1773: elsif p_ext_date_cd = 'TOPW' then
1774: -- Perivious TUE previous
1775: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)
1776: -decode(greatest((to_number(to_char(p_abs_date,'D')) -3),0.99) ,0.99,14,7))

Line 1777: into l_rslt_dt from dual ;

1773: elsif p_ext_date_cd = 'TOPW' then
1774: -- Perivious TUE previous
1775: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -3)
1776: -decode(greatest((to_number(to_char(p_abs_date,'D')) -3),0.99) ,0.99,14,7))
1777: into l_rslt_dt from dual ;
1778: elsif p_ext_date_cd = 'WOPW' then
1779: -- Perivious wednesday previous
1780: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1781: -decode(greatest((to_number(to_char(p_abs_date,'D')) -4),0.99) ,0.99,14,7))

Line 1782: into l_rslt_dt from dual ;

1778: elsif p_ext_date_cd = 'WOPW' then
1779: -- Perivious wednesday previous
1780: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -4)
1781: -decode(greatest((to_number(to_char(p_abs_date,'D')) -4),0.99) ,0.99,14,7))
1782: into l_rslt_dt from dual ;
1783: elsif p_ext_date_cd = 'THOPW' then
1784: -- Perivious thursday of previous
1785: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)
1786: -decode(greatest((to_number(to_char(p_abs_date,'D')) -5),0.99) ,0.99,14,7))

Line 1787: into l_rslt_dt from dual ;

1783: elsif p_ext_date_cd = 'THOPW' then
1784: -- Perivious thursday of previous
1785: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -5)
1786: -decode(greatest((to_number(to_char(p_abs_date,'D')) -5),0.99) ,0.99,14,7))
1787: into l_rslt_dt from dual ;
1788: elsif p_ext_date_cd = 'FOPW' then
1789: -- Perivious friday of previous
1790: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)
1791: -decode(greatest((to_number(to_char(p_abs_date,'D')) -6),0.99) ,0.99,14,7))

Line 1792: into l_rslt_dt from dual ;

1788: elsif p_ext_date_cd = 'FOPW' then
1789: -- Perivious friday of previous
1790: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -6)
1791: -decode(greatest((to_number(to_char(p_abs_date,'D')) -6),0.99) ,0.99,14,7))
1792: into l_rslt_dt from dual ;
1793: elsif p_ext_date_cd = 'SAOPW' then
1794: -- Perivious saturday of previous
1795: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)
1796: -decode(greatest((to_number(to_char(p_abs_date,'D')) -7),0.99) ,0.99,14,7))

Line 1797: into l_rslt_dt from dual ;

1793: elsif p_ext_date_cd = 'SAOPW' then
1794: -- Perivious saturday of previous
1795: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -7)
1796: -decode(greatest((to_number(to_char(p_abs_date,'D')) -7),0.99) ,0.99,14,7))
1797: into l_rslt_dt from dual ;
1798: elsif p_ext_date_cd = 'SUOPW' then
1799: -- Perivious sunday of previous
1800: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -1)
1801: -decode(greatest((to_number(to_char(p_abs_date,'D')) -1),0.99) ,0.99,14,7))

Line 1802: into l_rslt_dt from dual ;

1798: elsif p_ext_date_cd = 'SUOPW' then
1799: -- Perivious sunday of previous
1800: select trunc(p_abs_date-(to_number(to_char((p_abs_date),'D')) -1)
1801: -decode(greatest((to_number(to_char(p_abs_date,'D')) -1),0.99) ,0.99,14,7))
1802: into l_rslt_dt from dual ;
1803:
1804: elsif p_ext_date_cd = 'CM16' then
1805: -- 16th of current month
1806: l_rslt_dt := trunc(trunc(p_abs_date,'MM')+15);