Results 1 to 3 of 3

Thread: Joining SQL queries in ASP

  1. #1
    Duncan Greer Guest

    Joining SQL queries in ASP

    Hi,
    I`m quite new to both ASP and SQL queries and I am currently having a problem with my
    University project.

    I need to do a query against a table which doesn`t show any results which occur in a sub
    query.

    This is what I currently have :

    SELECT DISTINCT Question.QuestionID, QuestionName FROM Question
    LEFT JOIN [Sub Query] s
    ON Question.QuestionID = [Sub Query].QuestionID
    WHERE LecturerID = 2 and ((([Sub Query].QuestionID) Is Null))"



    My Sub Query should be "select QuestionID from SectionQList where SectionID ="&SID&"

    What is don`t know how to do is pass a parameter into my Sub Query in order to limit it`s
    results.

    I Hope this makes some sense.

    I would appreciate any help.

    Thanks,

    Duncan

  2. #2
    John Guest

    Joining SQL queries in ASP (reply)

    Hi Duncan,

    How about making it a Stored Procedure and passing it a parameter? ASP-dbPro supports stored procs with parameter passing using the dbStoredProc parameter.

    Hope this helps,
    John



    On 10/27/98 5:36:46 PM, Duncan Greer wrote:
    > Hi,
    I`m quite new to both ASP and SQL queries and I am currently
    > having a problem with my
    University project.

    I need to do a
    > query against a table which doesn`t show any results which occur in a sub
    >
    query.

    This is what I currently have :

    SELECT DISTINCT
    > Question.QuestionID, QuestionName FROM Question
    LEFT JOIN [Sub
    > Query] s
    ON Question.QuestionID = [Sub Query].QuestionID

    > WHERE LecturerID = 2 and ((([Sub Query].QuestionID) Is Null))"



    My
    > Sub Query should be "select QuestionID from SectionQList where SectionID
    > ="&SID&"

    What is don`t know how to do is pass a parameter into my Sub
    > Query in order to limit it`s
    results.

    I Hope this makes some
    > sense.

    I would appreciate any help.

    Thanks,

    Duncan

  3. #3
    Duncan Guest

    Joining SQL queries in ASP (reply)

    On 10/27/98 11:40:29 PM, John wrote:
    > Hi Duncan,

    How about making it a Stored Procedure and passing it a
    > parameter? ASP-dbPro supports stored procs with parameter passing using
    > the dbStoredProc parameter.

    Hope this helps,
    John

    Thanks a lot, I'll try that.

    Duncan

Posting Permissions

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