Hello,
I'm trying to write a procedure that inserts into a table the total hours worked by dept and area summed by months using YYYY-MM as the date format. The date field I'm looking at is in YYYY-MM-DD format. Currently I'm using AND A.L_DATE_UNDER_RPT >= SYSDATE - 60 and A.L_DATE_UNDER_RPT <= sysdate - 30 but I want to take data that is 2 months old and summarize that every month. So like for May 1st I want to summarize data from March. Is there a way to do this in an Oracle procedure? I don't want to just use the above code because I won't get all the data when there are 31 days in the month. Any help would be GREATLY appreciated.
Thanks
I'm trying to write a procedure that inserts into a table the total hours worked by dept and area summed by months using YYYY-MM as the date format. The date field I'm looking at is in YYYY-MM-DD format. Currently I'm using AND A.L_DATE_UNDER_RPT >= SYSDATE - 60 and A.L_DATE_UNDER_RPT <= sysdate - 30 but I want to take data that is 2 months old and summarize that every month. So like for May 1st I want to summarize data from March. Is there a way to do this in an Oracle procedure? I don't want to just use the above code because I won't get all the data when there are 31 days in the month. Any help would be GREATLY appreciated.
Thanks