Results 1 to 4 of 4

Thread: Queries

  1. #1
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59

    Unanswered: Queries

    Hi
    I've created a query based on 4 other queries so that i can generate a report from it.

    SELECT Count(*) AS Modules_Taken FROM [AUDIT_Module Testes Taken after 17/09/03]
    UNION
    SELECT Count(*) AS Registered_Issued FROM [AUDIT_Logbooks Registered/Issued after 17/09/03]
    UNION
    SELECT Count(*) AS Candidates FROM [AUDIT_Candidates after 17/09/03]
    UNION
    SELECT Count(*) AS Candidates_Complete FROM [AUDIT_Candidates complete after 17/09/03];

    But when i run the query i get 1 col with a title of Modules_Taken.

    Can you get the results in seperate columns like so:

    Modules Taken Registered/Issued Candidates Candidates Complete
    55 58 9 5

    Is this possible

    thanks
    Icerat

  2. #2
    Join Date
    Apr 2004
    Posts
    64
    Aye, it is possible. Try

    SELECT
    (SELECT Count(*) FROM [AUDIT_Module Testes Taken after 17/09/03]) AS Modules_Taken,
    (SELECT Count(*) FROM [AUDIT_Logbooks Registered/Issued after 17/09/03]) AS Registered_Issued,
    (SELECT Count(*) FROM [AUDIT_Candidates after 17/09/03]) AS Candidates,
    Count(*) AS Candidates_Complete FROM [AUDIT_Candidates complete after 17/09/03];

  3. #3
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59
    Hi :-) :-)

    Many Many Thanks, been tring to sort this all weekend, you know of any good sites where a beginner like me can learn this stuff.

    Many thanks again

    Icerat

  4. #4
    Join Date
    Apr 2004
    Posts
    64
    Quote Originally Posted by Icerat
    ...you know of any good sites where a beginner like me can learn this stuff...
    Unfortunately I cannot recommend any material but there's plenty of tutorials online... The only thing I can recommend is to continue banging away... Trial and error first, theory later!

    Ciao
    :-)

Posting Permissions

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