Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refering

Status
Not open for further replies.

delorfra

Programmer
Mar 8, 2001
79
FR
ASP3/ADO/Oracle8
I desesperatly need help on this since I have almost looked everywhere and could not find any clear solution to my problem. I am stuck.

Let's say i have two recordsets that I build with criteria entered in a form by users (here CustID).

....
mysql1="select partno, sum([QtyNC]) as TotNC from CustNCReports where CustID=" & CustID & " group by partNo"
oRS1.Open mysql1, oConn
...

mysql2 ="select partno, sum([QtyDelivered]) as TotDelivered from Deliveries where CustID=" & CustID & " group by partNo"
oRS2.Open mysql2, oConn
...

Now, how can I refer to the first and second query in a third query like below. I simulate that you can call the queries using mysql1 or 2 as names to show you what I am trying to do :

mysql3 = "select partno, (mysql1.TotNC/mysql2.TotDelivered) from mysql1, mysql2 as PPM where mysql1.partNo=mysql2.partNo"
oRS3.Open mysql3, oConn

You can see there is no Parent/Child relationship between recordsets.

Also, if stored procedures are required how to create Oracle temporary views (with criteria as parameters) whose names I would call in the third query ?


Thanks if anybody has any idea.

 
Have you tried to use join or union in your SQL String?
I am also not very clear on your third sql string.

s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Hi,
The 3rd query divides the result of the first query : total number of non-conforming parts (from the Non-conformity report table) by the result of the second query : total number of parts delivered to customers (from the Deliveries table).
Each query is performed depending on criteria (like selecting the customer, the part group/familly etc ..) entered by the user.


Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top