Home » SQL & PL/SQL » SQL & PL/SQL » Matrix report problem (Reports 6i)
Matrix report problem [message #443012] Fri, 12 February 2010 00:56 Go to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
hey buddies,
your help required.


My view structure is

invoice_date date
amount number(10,2);
dealer_code number(10);

now i want to make report like

days days days days
date 1-30 30-60 60-90 90-above
dealer_code
123 1500 1000 8000 45000
124 4000 6000 6500 32000
125

i will pass date parameter to report.it will display sale upto that date in the above format.

what query should i use
i hope you understand it.

Thanks

Athar




[Updated on: Fri, 12 February 2010 01:01]

Report message to a moderator

Re: Matrix report problem [message #443015 is a reply to message #443012] Fri, 12 February 2010 01:02 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select deptno,
  2         count(case when sal <= 1000 then 1 end) "<= 1000",
  3         count(case when sal > 1000 and sal <= 2000 then 1 end) "1000-2000",
  4         count(case when sal > 2000 and sal <= 3000 then 1 end) "2000-3000",
  5         count(case when sal > 3000 then 1 end) "> 3000" 
  6  from emp
  7  group by deptno
  8  order by deptno
  9  /
    DEPTNO    <= 1000  1000-2000  2000-3000     > 3000
---------- ---------- ---------- ---------- ----------
        10          0          0          0          1
        20          1          1          3          0
        30          1          4          1          0

3 rows selected.

Regards
Michel
Re: Matrix report problem [message #443020 is a reply to message #443012] Fri, 12 February 2010 01:34 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
Thanks for reply dear.


my problem is still there

as amt and invoice_date has different date types.

the query end in an error "inconsistent data types"

Thanks once again

Athar
Re: Matrix report problem [message #443023 is a reply to message #443020] Fri, 12 February 2010 02:08 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
We can't debug something we don't see.
If you post a working Test case: create table and insert statements along with the result you want with these data then we will work with your table and data.


Regards
Michel

[Updated on: Fri, 12 February 2010 02:10]

Report message to a moderator

Re: Matrix report problem [message #443024 is a reply to message #443012] Fri, 12 February 2010 02:10 Go to previous message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
Sorry Michel,

i was wrong .

your solution is working.


Thanks a lot.


Athar
Previous Topic: Possible to carry forward information from one record to the next?
Next Topic: encrypt a few filds in the database
Goto Forum:
  


Current Time: Tue Sep 27 22:56:49 CDT 2016

Total time taken to generate the page: 0.09468 seconds