|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
select entries from whole week
Hello,
I'd like to get all entries from "the whole week" (begin: Monday end: Sunday) from e.g the day sysdate - 222 (today: 20.10.2004) .This means all entries with a date between 08.03.2004 and 14.03.2004 (including the borders !) |
|
#2
|
|||
|
|||
|
I think you can use trunc(date,'day') here. you have to be careful because it returns a different date depending on your nls settings.
for me Code:
select trunc(sysdate,'day') from dual; returns the 17th which is sunday so I'd use a query like this Code:
select * from table where table.date >= trunc(sysdate,'day')+1 and table.date <= trunc(sysdate,'day')+7 you might also want to try the trunc format 'IW' which Oracle says is: Same day of the week as the first day of the ISO year. ... for me that returns monday. Last edited by hedge : October 21st, 2004 at 09:25 AM. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > select entries from whole week |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|