Need Help Creating Query Layer From Oracle For Past 365 Days

المشرف العام

Administrator
طاقم الإدارة
I have several Query layers that work fine for generic, long term date ranges such as:

This shows all entries that have the previous YEAR in the date field.

AND To_char(ds.calendar_date, 'YYYY') = To_char(( Extract(year FROM add_months(sysdate, -12)) ))This shows all entries of previous 12 months as well as ALL of previous year

AND To_char(ds.calendar_date, 'YYYY') = To_char(( Extract(year FROM add_months(sysdate,-12)) )) AND To_char(ds.calendar_date, 'YYYY') = To_char(( Extract(year FROM sysdate) )) I need something that will show the previous 365 days.

I've tried using AND To_char(ds.calendar_date) >= To_char(sysdate-365) but I get nothing. I've done several iterations with (and without) the To_char operator but nothing does it. The sysdate-365 gives me records from 2004?! I feel like the answer is simple and it will be something along the lines of an ESRI / Oracle / Query layer oddity.



أكثر...
 
أعلى