Home » SQL & PL/SQL » SQL & PL/SQL » display records for Dates every 7 days
display records for Dates every 7 days [message #281072] Thu, 15 November 2007 11:30 Go to next message
speaker
Messages: 30
Registered: April 2006
Member
Hi,

Given startDate and EndDate i need to get the list of dates like following

startdate + 7 till end date


eg: from 10Oct 2007 to 10Nov2007

i need like

10/10/2007
10/17/2007
10/24/2007
10/31/2007
11/07/2007 till 10 Nov only

Pls help
Re: display records for Dates every 7 days [message #281074 is a reply to message #281072] Thu, 15 November 2007 11:41 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
Here is a good start, not the complete answer as you'll need to do some for yourself.

select * from (
select to_date('10-oct-2007','dd-mon-yyyy')+(rownum-1)*10 aaa
from dual connect by level <= 10)
/
Re: display records for Dates every 7 days [message #281075 is a reply to message #281074] Thu, 15 November 2007 11:42 Go to previous message
speaker
Messages: 30
Registered: April 2006
Member
Thanks
i managed with this

select to_date('1/10/2007','DD/MM/YYYY')+7*rownum  from  dmt_clinical_data  where rownum<5

[Updated on: Thu, 15 November 2007 11:43]

Report message to a moderator

Previous Topic: Triggers failling.......
Next Topic: Fetch special datas of any table in a procedure with ref cursor
Goto Forum:
  


Current Time: Sun Dec 04 06:36:43 CST 2016

Total time taken to generate the page: 0.07219 seconds