How to get Today, Yesterday , First Day Of Month, Last Day Of Month...in Oracle?
if you want to get: Today, Yesterday , First Day Of Month, Last Day Of Month, etc...in Oracle Query
you can follow sample bellow:
----------------------------------------
SELECT
&PM_TODATE AS TODAY
,&PM_TODATE-1 AS YDAY
,TRUNC(&PM_TODATE,'MM') AS FDAY_MON
,TRUNC(TRUNC(&PM_TODATE,'MM')-1,'MM') AS FDAY_LMON
,TRUNC(&PM_TODATE,'MM')-1 AS LDAY_LMON
,TRUNC(TRUNC(&PM_TODATE,'YYYY')-1,'YYYY') AS FDAY_LYEAR
,TRUNC(&PM_TODATE,'YYYY')-1 AS LDAY_LYEAR
FROM DUAL;
---------------------------------------
Thank You!
Post a Comment