Home » SQL & PL/SQL » SQL & PL/SQL » Need Function/sql query (oracle pl sql)
Need Function/sql query [message #572423] Wed, 12 December 2012 00:02 Go to next message
mvrkr44
Messages: 35
Registered: December 2012
Member
I need to get the reult based on input

i will pass the date as input
i need to get the data for 1 year like it needs to add the 14 days continously to one year.

ex:input date 1-jan-2012
output should be
1-jan-2012
14-jan-2012
28-jan-2012
12-feb-2012
26-feb-2012
10-mar-2012
24-mar-2012
08-Apr-2012
|
|
|
|
30-Dec-2012
Re: Need Function/sql query [message #572436 is a reply to message #572423] Wed, 12 December 2012 01:45 Go to previous messageGo to next message
Michel Cadot
Messages: 58597
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Welcome to the forum.

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

With any SQL or PL/SQL question, please, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Have a look at row generator topic.

Regards
Michel
Re: Need Function/sql query [message #572455 is a reply to message #572423] Wed, 12 December 2012 03:29 Go to previous message
dariyoosh
Messages: 531
Registered: March 2009
Location: Iran / France
Senior Member
mvrkr44 wrote on Wed, 12 December 2012 07:02
... i need to get the data for 1 year like it needs to add the 14 days continually to one year ...

Well, in the list of values you provided in the OP, you stop at the end of the current year. However in your example you started at the beginning of the year (01-JAN-2012). What if the start date is for example 01-APR-2012 ? should the list be limited again to 31-DEC-2012 or actually counting a year (in terms of number of days from the starting day) and stop at 01-APR-2013?

In addition (take it just as a suggestion Smile) it would be more appropriate to chose a clearer subject for your topic. There are many threads created on the forum with subjects such as: Help, Query, update query, need query, help on query, SQL query, ...
It would be a matter of time for the forum Research function to become completely useless for those who probably may have/will have encountered the same problem.


Regards,
Dariyoosh

[Updated on: Wed, 12 December 2012 03:30]

Report message to a moderator

Previous Topic: Export BLOB file in Excel
Next Topic: convert the given sql to procedure
Goto Forum:
  


Current Time: Mon Jul 28 02:02:57 CDT 2014

Total time taken to generate the page: 0.10904 seconds