DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: how to join the output of multiple qeries in MS Access

  1. #1
    Join Date
    Feb 2007

    Question how to join the output of multiple qeries in MS Access


    i m writing a query to join the output of multiple queries in MS Access.

    for example:

    i have 3 tables Audio,Video,Broadcast
    i have written 3 queries to extract the count of records in the above 3 tables depending upon a condition.

    select count(ID) from Audio where somecolunm="something";
    select count(ID) from Video where somecolunm="something";
    select count(ID) from Broadcast where somecolunm="something";

    These queries will give a a single value as output.

    i want to insert corresponding values in a table which has a the following fields


    how do i prepare a query to do this?

    this is the first time i m writing SQL please help me out..
    Last edited by; 04-29-2007 at 03:34 AM. Reason: spelling correction

  2. #2
    Join Date
    Nov 2003
    Portland, OR
    Assuming your output table is named "output," try this:

    INSERT INTO [output] (audio, video, broadcast)
    SELECT COUNT ( AS audio,
    COUNT( AS video,
    COUNT( AS broadcast
    FROM (audio INNER JOIN video ON audio.somecolumn = video.somecolumn)
    INNER JOIN broadcast ON video.somecolumn = broadcast.somecolumn
    WHERE audio.somecolumn = 'something'
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 1
    Last Post: 04-24-2008, 06:03 AM
  2. Multiple Access
    By Sumit in forum VB Classic
    Replies: 0
    Last Post: 09-09-2006, 11:41 AM
  3. Replies: 0
    Last Post: 11-28-2005, 01:56 PM
  4. Replies: 13
    Last Post: 04-10-2002, 02:22 PM
  5. Replies: 3
    Last Post: 06-12-2001, 11:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center