|
-
Aug 14th, 2001, 10:09 AM
#1
Thread Starter
New Member
applications using VB and Access
I've got 2 queries in MS Access.The queries are as follows.
query1:
SELECT qryPanelsandParts.Type, Sum(qryPanelsandParts.Sales) AS [SumOfTotal Sales], qryPanelsandParts.QuoteOnly
FROM qryPanelsandParts
GROUP BY qryPanelsandParts.Type, qryPanelsandParts.Year, qryPanelsandParts.QuoteOnly
HAVING (((qryPanelsandParts.Year)=[Forms]![frmMenu]![cboYear]) AND ((qryPanelsandParts.QuoteOnly)=False));
Query 2 (qryPanelsandParts) :
SELECT Customers.CustomerName, PanelsandParts.CustomerID, PanelsandParts.Job, PanelsandParts.Sales, PanelsandParts.Material, PanelsandParts.EngHrs, [EngHrs]*[EngRate] AS EngCost, PanelsandParts.PnlHrs, [PnlHrs]*[PnlRate] AS PnlCost, [EngCost]+[PnlCost] AS Labor, [Material]+[Labor] AS Cost, [Sales]-[Cost] AS GMDollars, [GMDollars]/[Sales] AS GMPct, PanelsandParts.QuoteOnly, PanelsandParts.Month, PanelsandParts.Year, PanelsandParts.Type
FROM Rates, Customers INNER JOIN PanelsandParts ON Customers.CustomerID = PanelsandParts.CustomerID
WHERE (((PanelsandParts.QuoteOnly)=False));
here query1 is using query2 and quey2 uses only tables. I can able to execute query2 directly in a vb form but not query1 since it is using query2 in it.
I just want to join these two queries to make a single sql statement and use it in a VB form at run time.
or please tell me is there anyother way to use both the access "queries" directly in a vb form without writing a new sql statement .Please send me the reply soon.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|