Home » Developer & Programmer » Reports & Discoverer » Month Days Displayed
Month Days Displayed [message #627202] Sat, 08 November 2014 21:49 Go to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
Dear Sir,
i want to display the month (which select from parameter form) days as header in report.please advised.

[Updated on: Sat, 08 November 2014 21:53]

Report message to a moderator

Re: Month Days Displayed [message #627208 is a reply to message #627202] Sun, 09 November 2014 03:20 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As it is just a parameter, create a field in report's header and base it on that parameter.

Basically, this is rather straightforward, I'm not sure why you think it is a problem that requires someone's assistance.
Re: Month Days Displayed [message #630634 is a reply to message #627208] Thu, 01 January 2015 05:04 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
select last_day(add_months(sysdate, -1))+1+rownum-1 
from dual 
connect by 
rownum < last_day(sysdate)-(last_day(add_months(sysdate, -1))+1)+1

but it will shows me 01-JAN-2015 ONLY
Instead of
01-JAN-2015
02-JAN-2015
03-JAN-2015
04-JAN-2015
.....
30-JAN-2015
31-JAN-2015

PLEASE ADVISED. i want the above detail.

[Updated on: Thu, 01 January 2015 06:31]

Report message to a moderator

Re: Month Days Displayed [message #630639 is a reply to message #630634] Thu, 01 January 2015 09:49 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Your code is
a) wrong (ends with 30.01.2015)
b) too complicated; it could be rewritten as
SQL> alter session set nls_date_format = 'dd.mm.yyyy';

Session altered.

SQL> select trunc(sysdate, 'mm') + level - 1 datum
  2  from dual
  3  connect by level <= to_number(to_char(last_day(sysdate), 'dd'));

DATUM
----------
01.01.2015
02.01.2015
03.01.2015
04.01.2015
05.01.2015
<snip>
29.01.2015
30.01.2015
31.01.2015

31 rows selected.

SQL>


If you are saying that you used it in Reports Builder and it doesn't return the result you expected, try to use it as an inline view:
select datum 
from (select trunc(sysdate, 'mm') + level - 1 datum
      from dual
      connect by level <= to_number(to_char(last_day(sysdate), 'dd'))
     );


If it still doesn't work, create a view and then select from that view.
Re: Month Days Displayed [message #631206 is a reply to message #630639] Sat, 10 January 2015 05:49 Go to previous message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
thanks for your help it works.
Previous Topic: Print BARCODE from EBSR12 to Zeebra TLP 2844
Next Topic: count sundays
Goto Forum:
  


Current Time: Thu Mar 28 15:14:09 CDT 2024