Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date problem in SQL
On Fri, 13 Nov 1998 20:40:42 +0100, bea_at_algonet.se (Bjorn E. Andersson) wrote:
>I have a table xxx with columns a, b, c, d
>where column d is date, including time in HH24MI format.
>
>How can I do a select with all records between
>last Friday 0000 and sysdate?
Use date functions TRUNC and NEXT_DATE and a simple date arithmetics:
SELECT a, b, c, d FROM my_table
WHERE d BETWEEN (TRUNC(NEXT_DAY(sysdate,'FRIDAY'))-7) AND sysdate;
Note that the name of the day must correspond to your NLS settings.
>
>Any ideas will be appriciated.
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)
![]() |
![]() |