|
-
problem showing all dates in current month of last year
i have written this code but it only returns those with dates before the current date in the month e.g it onl returns the dates in december before the 8th as that is todays date nd i need it to display all dates in december the year before and it needs to bethe same code for next month.
select customer_id, movie_id,download_date
from tbl_download
where download_date = trunc( add_months( sysdate, -12 ), 'MM' )
i then tried adding
select customer_id, movie_id,download_date
from tbl_download
where download_date = trunc( add_months( sysdate, -12 ), 'MM' ) and download_date <= LAST_DAY(TRUNC(ADD_MONTHS(SYSDATE, -12),'MM'))
and that makes no difference. any ideas how to make this work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|