I have 2 tables as listed below
1. Activity table
col type
--- -----
oid number(PK)
create_time datetime
oppr_oid number(FK)
2. Opportunity table
col type
--- -----
oppr_oid number(PK)
opportunity_id text
Values for the above tables can be
Opportunity
1 Opp1
2 Opp2
3 Opp3
4 Opp4
Activity
1 04/01/04 1
2 04/03/04 2
3 04/03/04 1
4 04/11/04 3
I want to generate a report based on the below query
Also the report should show data on weekly basis(group by createtime).
select opportunity.opportunity_id,max(activity.createtime) from opportunity,activity where opportunity.oppr_oid=activity.oppr_oid group by opportunity.opportunity_id
The report should look something like as shown below
Week 04/01/04
Opp1 04/03/04
Opp2 04/03/04
Week 04/08/04
Opp3 04/11/04
I have tried using group by Opportunity_id(ascending) and put createtime and opportunity_id in the group footer. Also I suppressed the header and detail section. But in that case I am not able to display the data in weekly basis.
Any help will be highly appreciated.
1. Activity table
col type
--- -----
oid number(PK)
create_time datetime
oppr_oid number(FK)
2. Opportunity table
col type
--- -----
oppr_oid number(PK)
opportunity_id text
Values for the above tables can be
Opportunity
1 Opp1
2 Opp2
3 Opp3
4 Opp4
Activity
1 04/01/04 1
2 04/03/04 2
3 04/03/04 1
4 04/11/04 3
I want to generate a report based on the below query
Also the report should show data on weekly basis(group by createtime).
select opportunity.opportunity_id,max(activity.createtime) from opportunity,activity where opportunity.oppr_oid=activity.oppr_oid group by opportunity.opportunity_id
The report should look something like as shown below
Week 04/01/04
Opp1 04/03/04
Opp2 04/03/04
Week 04/08/04
Opp3 04/11/04
I have tried using group by Opportunity_id(ascending) and put createtime and opportunity_id in the group footer. Also I suppressed the header and detail section. But in that case I am not able to display the data in weekly basis.
Any help will be highly appreciated.