Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Last Week
Bill wrote:
> I'm trying to extract records from a table for last week. I would
> like a sample query that will select those records even over the end
> of the year.
>
> Thanks
>
> Bill
Take a good look at the TO_CHAR function. Using it with any date should give you what you want.
To start with try the following:
SELECT TO_CHAR(sysdate, 'D') from dual;
SELECT TO_CHAR(sysdate, 'DD') from dual;
SELECT TO_CHAR(sysdate, 'DAY') from dual;
Daniel Morgan Received on Mon Jan 27 2003 - 17:40:23 CST