Results 1 to 3 of 3

Thread: query dependent on another query

  1. #1
    Davisricky is offline Senior Member
    Join Date
    Dec 2009
    Posts
    331
    Rep Power
    3

    Default query dependent on another query

    Want to make query dependent on another query.

    In MS-Access 2003 I have created ten fields, on that fields I have to create query. I would like to create query on these fields in such a way that one reliant on the other. It means when one query run its reliant query is automatically run. Can anybody help me to how to make query dependent on another query.

  2. #2
    Garcíarobine is offline Senior Member
    Join Date
    Dec 2009
    Posts
    334
    Rep Power
    3

    Default

    It is very easy to create query reliant on another query. You have to just insert one query's name into another. In this manner you have to insert one query's name into another to get the result. Try to understand following code which I given below.

    SELECT tableName.[Companys], tableName.[Companys] FROM tableName where not(tableName.[Companys]) is null UNION SELECT "*", "<All>" From tableName

    ORDER BY 2;
    Last edited by nitesh14; 02-06-2010 at 03:26 PM.

  3. #3
    RodríguezBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    322
    Rep Power
    3

    Default

    Try to understand following code which is helps you to make query dependent on another query.


    USE AdventureWorks ;
    GO
    SELECT DISTINCT c.LastName, c.FirstName
    FROM Person.Contact c JOIN HumanResources.Employee e
    ON e.ContactID = c.ContactID WHERE EmployeeID IN
    (SELECT SalesPersonID
    FROM Sales.SalesOrderHeader
    WHERE SalesOrderID IN
    (SELECT SalesOrderID
    FROM Sales.SalesOrderDetail
    WHERE ProductID IN
    (SELECT ProductID
    FROM Production.Product p
    WHERE ProductNumber LIKE'FW%')));
    GO
    Last edited by nitesh14; 02-06-2010 at 03:27 PM.

Similar Threads

  1. Video card query
    By Sandy Patrick in forum Video Card
    Replies: 4
    Last Post: 11-04-2010, 03:05 PM
  2. CPU RMA OC query
    By WilsonMartin in forum other peripherals
    Replies: 3
    Last Post: 08-06-2010, 05:47 PM
  3. Overclocking query
    By HowardAllen in forum Overclocking
    Replies: 4
    Last Post: 08-06-2010, 03:21 PM
  4. query regarding C#
    By Priscila king in forum Programming
    Replies: 1
    Last Post: 07-22-2010, 10:49 AM
  5. query not working
    By TaylorRyan in forum Operating System
    Replies: 1
    Last Post: 02-18-2010, 01:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48