Home » Developer & Programmer » Reports & Discoverer » Problem in Query during creating Report (10g Database)
Problem in Query during creating Report [message #437759] Tue, 05 January 2010 23:13 Go to next message
allianz2010
Messages: 101
Registered: October 2009
Location: Pakistan
Senior Member

I m creating a report in Report 6i and i create it..

but not i want to make some change in this that...

i have two table Master and Detail Table...

First when i create report i just use Detail Table and create the report ...

but now requirement is change that...

i want to retrieve just those record which dates between two dates....
and date field is in Master table and i m use Group by clause in my previous report.. and when i join these table then its say that which field i add in my report its not group by field...

and when i add this field too in group by clause then my retrieved record not retrieve correctly......

...
Re: Problem in Query [message #437762 is a reply to message #437759] Tue, 05 January 2010 23:19 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
1) You should post this in reports forum not in sql/plsql.
2) you/we can do based on requirement as its a tool
3) You have two table you need to call that report from using all the required columns from one table and compare one field with another one right? You can refer that column to validate right?

We don't know how you are doing that...
And we dont know any thing about your tables relation?
How can you ask without any information provided?

sriram Smile
Re: Problem in Query [message #437764 is a reply to message #437759] Tue, 05 January 2010 23:20 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Read the Forum Guide first, for examples on what information is required to get more meaningful answers.
Re: Problem in Query [message #437866 is a reply to message #437759] Wed, 06 January 2010 05:28 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i want to retrieve just those record which dates between two dates.... and date field is in Master table and i m use Group by clause in my previous report.. and when i join these table then its say that which field i add in my report its not group by field...

I don't know how query looks like now (nor how it looked like before), but - did you have to add that column into the query? Could you have done it differently?

I *suppose* that your query might have looked like this:
select d.ename,
       d.hiredate,
       sum(d.salary) sal
from detail d
group by d.ename, d.hiredate

Now that you have included the "master" table and parameter date values (par_date_from and par_date_to), it looks like this:
select d.ename,
       d.hiredate,
       sum(d.salary) sal,
       m.some_column        --> newly added master table column
from detail d,
     master m
where d.id = m.id
  and m.date_column between :par_date_from and :par_date_to
group by d.ename, d.hiredate
, m.some_column             --> did you forget to include it into 
                            --  the GROUP BY clause? 

If you don't really need the "m.some_column" in SELECT column list, how about this:
select d.ename,
       d.hiredate,
       sum(d.salary) sal
from detail d
where d.id in (select m.id 
               from master m
               where m.date_column between :par_date_from and :par_date_to
              )               
group by d.ename, d.hiredate

Re: Problem in Query [message #438424 is a reply to message #437866] Fri, 08 January 2010 22:03 Go to previous message
allianz2010
Messages: 101
Registered: October 2009
Location: Pakistan
Senior Member

Thank you very very very much...
sir.......


i done it...
Previous Topic: Report web lay out creating error
Next Topic: Failed to locate the browser
Goto Forum:
  


Current Time: Wed Nov 27 07:00:10 CST 2024