Home » SQL & PL/SQL » SQL & PL/SQL » Helpp!!
Helpp!! [message #211864] Tue, 02 January 2007 13:54 Go to next message
ship6wreck
Messages: 4
Registered: January 2007
Location: Tema
Junior Member
how do i query a database to return a list of dates for the first month of every quarter?
Re: Helpp!! [message #211865 is a reply to message #211864] Tue, 02 January 2007 13:57 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>how do i query a database to return a list of dates for the first month of every quarter?
By using SQL
Re: Helpp!! [message #211867 is a reply to message #211865] Tue, 02 January 2007 14:44 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Got my chuckle for the day, ty anacedent
Re: Helpp!! [message #211871 is a reply to message #211864] Tue, 02 January 2007 15:39 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
Additional information would be appreciated. Do you want every day of the month for January, April, July, and October. Or do you want the dates that the periods consist of? What do you want, be more clear.
Re: Helpp!! [message #212096 is a reply to message #211871] Wed, 03 January 2007 15:45 Go to previous messageGo to next message
ship6wreck
Messages: 4
Registered: January 2007
Location: Tema
Junior Member
That's it Bill.
tanx

[Updated on: Wed, 03 January 2007 15:50]

Report message to a moderator

Re: Helpp!! [message #212148 is a reply to message #212096] Thu, 04 January 2007 00:47 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's what? I still don't understand it ...
Re: Helpp!! [message #212152 is a reply to message #212148] Thu, 04 January 2007 00:53 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Q: Do you want A or B
A: Yep.
Re: Helpp!! [message #212272 is a reply to message #212096] Thu, 04 January 2007 08:06 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
This is a shipwreck waiting to happen.
Re: Helpp!! [message #212302 is a reply to message #212272] Thu, 04 January 2007 10:59 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hilarious! ./fa/1950/0/
Re: Helpp!! [message #212465 is a reply to message #212096] Fri, 05 January 2007 08:08 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
ship6wreck wrote on Wed, 03 January 2007 15:45
That's it Bill.
tanx


Thank you, but which of the 2 options do you want. Either one is easy, I just need to know which one.
Re: Helpp!! [message #212547 is a reply to message #212465] Fri, 05 January 2007 15:38 Go to previous messageGo to next message
ship6wreck
Messages: 4
Registered: January 2007
Location: Tema
Junior Member
Glad i managed to brighten up this place a bit.
Anyway, just give me both queries, Bill.

tanx
Re: Helpp!! [message #212811 is a reply to message #211864] Mon, 08 January 2007 07:54 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
select to_char(the_date,'MM/DD/YYYY')
FROM
(select trunc(sysdate,'YY') + (rownum - 1) the_date
FROM ALL_OBJECTS
WHERE ROWNUM < 367)
WHERE TO_CHAR(THE_DATE,'MON') IN ('JAN','APR','JUL','OCT')
AND TRUNC (THE_DATE,'YY') = TRUNC(SYSDATE,'YY')
ORDER BY THE_DATE;

select to_char(the_date,'MM/DD/YYYY')
FROM
(select trunc(sysdate,'YY') + (rownum - 1) the_date
FROM ALL_OBJECTS
WHERE ROWNUM < 367)
WHERE TO_CHAR(THE_DATE,'MON-DD') IN ('JAN-01','APR-01','JUL-01','OCT-01')
AND TRUNC (THE_DATE,'YY') = TRUNC(SYSDATE,'YY')
ORDER BY THE_DATE;

Re: Helpp!! [message #212904 is a reply to message #212811] Mon, 08 January 2007 15:32 Go to previous message
ship6wreck
Messages: 4
Registered: January 2007
Location: Tema
Junior Member
tanx Bill, i really appreciate this.
Hope to catch u again soon.

ship6wreck, now adrift.
Previous Topic: Asynchronous execution with DBMS_SCHEDULER
Next Topic: help with TRIM
Goto Forum:
  


Current Time: Fri Dec 09 17:24:16 CST 2016

Total time taken to generate the page: 0.64242 seconds