+ Reply to Thread
Results 1 to 2 of 2

Combining Queries

  1. Combining Queries

    Hi,

    I have the following query called Q1 -

    SELECT TestVersion.TestId, TestVersion.VersionNo FROM (TestVersion
    LEFT JOIN Release ON TestVersion.ReleaseId = Release.ReleaseId) LEFT
    JOIN ReleasePlan ON Release.ReleaseId = ReleasePlan.ReleaseId WHERE
    (((ReleasePlan.StartDate)<=CDate("2006-04-19"))) ORDER BY
    TestVersion.TestId;

    plus this query -

    SELECT Max(Q1.VersionNo) AS MaxOfVersion, Q1.TestId FROM Q1 GROUP BY
    Q1.TestId;

    how can I combine these into one query.

    Thanks for your help,

    Aine


  2. Re: Combining Queries

    On Sep 11, 4:12 am, aine_ca...@yahoo.com wrote:
    > Hi,
    >
    > I have the following query called Q1 -
    >
    > SELECT TestVersion.TestId, TestVersion.VersionNo FROM (TestVersion
    > LEFT JOIN Release ON TestVersion.ReleaseId = Release.ReleaseId) LEFT
    > JOIN ReleasePlan ON Release.ReleaseId = ReleasePlan.ReleaseId WHERE
    > (((ReleasePlan.StartDate)<=CDate("2006-04-19"))) ORDER BY
    > TestVersion.TestId;
    >
    > plus this query -
    >
    > SELECT Max(Q1.VersionNo) AS MaxOfVersion, Q1.TestId FROM Q1 GROUP BY
    > Q1.TestId;
    >
    > how can I combine these into one query.
    >
    > Thanks for your help,
    >
    > Aine


    I believe you'd be able to put the selected columns in the beginning
    of your select query, and then put a comma after your from's table,
    and add in your second table.


+ Reply to Thread