Solved

current quarter and four future quarters

Posted on 2007-11-30
1
1,587 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

776 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