Solved

current quarter and four future quarters

Posted on 2007-11-30
1
1,585 Views
Last Modified: 2013-12-07
Hello Experts,

How to display current quarter and four future quarters using sysdate??

select 'Q'||to_char(sysdate,'Q')||'-'||to_char(sysdate,'YYYY') from dual;
Q4-2007
I want to generate the following:
Q4-2007
Q1-2008
Q2-2008
Q3-2008
Q4-2008
Thanks,
0
Comment
Question by:spsun
1 Comment
 
LVL 4

Accepted Solution

by:
radja7 earned 250 total points
ID: 20386296

SELECT 'Q'||to_char(dat,'Q')||'-'||to_char(dat,'YYYY') 

FROM (

  SELECT sysdate+(level-1)*91 as dat 

  FROM dual CONNECT BY level<=5

);

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now