Home » SQL & PL/SQL » SQL & PL/SQL » query
query [message #399781] Fri, 24 April 2009 01:14 Go to next message
tejas.patel
Messages: 22
Registered: December 2008
Location: NJ
Junior Member

dear sir,

I want a How many sunday in current month and range selected between two date in how many sunday get.
Re: query [message #399785 is a reply to message #399781] Fri, 24 April 2009 01:33 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This has already been discussed; please, search the board.
Re: query [message #399786 is a reply to message #399781] Fri, 24 April 2009 01:33 Go to previous messageGo to next message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@tejas.patel,

Have a look at TO_CHAR Function on Dates

Didn't understand the second part of your question though.

Regards,
Jo
Re: query [message #399789 is a reply to message #399781] Fri, 24 April 2009 01:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You will easely find the answer, it is in another topic titled "query".

Regards
Michel
Re: query [message #399840 is a reply to message #399789] Fri, 24 April 2009 04:38 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Michel Cadot wrote on Fri, 24 April 2009 08:44
You will easely find the answer, it is in another topic titled "query".

Regards
Michel


Laughing
Re: query [message #399849 is a reply to message #399781] Fri, 24 April 2009 04:50 Go to previous message
raja.or.king
Messages: 24
Registered: November 2008
Location: GJ 5
Junior Member
Don't know if better solution exists.

SQL>with date_table as
  2  (select to_date('1-jan-09','dd-mon-yy') date_col from dual)
  3  select
  4   trunc(((trunc(sysdate) - date_col) - to_char(next_day(date_col,'SUN'),'DD'))/7)+1 sundays
  5  from date_table;

   SUNDAYS
==========
        16

1 row selected.
Previous Topic: Help me to solve error ORA-00904 (merged 3)
Next Topic: alter query
Goto Forum:
  


Current Time: Thu Dec 08 18:06:35 CST 2016

Total time taken to generate the page: 0.26073 seconds