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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Stored Procedures/Views

Status
Not open for further replies.

Bensta

Programmer
Jul 21, 2003
122
US
Is there any way I could create a sub stored procedure or sub views in ADP as in Access mdb, which allows you to create sub-queries?
Thank you for any help
Bensta
 
Hi, The sub query has to be written in SQL something like

SELECT blah
FROM blahblah
WHERE blah IN (SELECT blah2 FROM blah)

you can put the sub query statement in the criteria box in design mode.

Hope that helps
 
Here is what my queries look like in Access MDB.
And I would to convert it to equivalent of either view and sub-view or stored procedure/sub stored procedure.
SELECT 1 AS [Count], [PCInventory].[NonBCSWorkstation], [PCModels].[ModelNumber], [PCInventory].[Physician Workstation], IIf(([Non-BayCare Workstation]=True),"NonBCS","BayCare") AS Type, [PCInventory].[Location ID], Location.[Location Name], [PCInventory].ID, [PCInventory].[AreaUser], [PCInventory].[AssetNumber], [PC Inventory].[ComputerName], [PCInventory].[Serial Number], [PC Inventory].[HardDrive], [PCInventory].[CDROM], [PCInventory].[SoundCard], [PCInventory].[OperatingSystem], [PCInventory].SOFTWARE AS Expr1, [PCInventory].Notes, [PCInventory].[Y2KPatches], [PCInventory].Printer, [PC Inventory].Monitor, [PCInventory].laptop, IIf(([printer]=True Or [monitor]=True Or [laptop]=True),"Other Equipment","PC Equipment") AS Equiptype, [PC Inventory].department
FROM ([PCInventory] LEFT JOIN [PCModels] ON [PCInventory].[ModelID] = [PCModels].[Model ID]) INNER JOIN Location ON [PCInventory].[LocationID] = Location.[LocationID]
WHERE (((Location.[LocationName])<>&quot;Retired&quot;))
ORDER BY [PCInventory].[NonBCSWorkstation] DESC , [PCModels].[ModelNumber];


My Sub query looks like this
SELECT qryPCsbyModel.Type, qryPCsbyModel.Equiptype, qryPCsbyModel.[Model Number], Sum(qryPCsbyModel.Count) AS SumOfCount
FROM qryPCsbyModel
GROUP BY qryPCsbyModel.Type, qryPCsbyModel.Equiptype, qryPCsbyModel.[ModelNumber];
I hope I am clear with my question and code
Thank you so much
Bensta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top