[help] Query with 1 or n parameter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maurizio.ferracini@gmail.com

    [help] Query with 1 or n parameter

    a student know one ore more programming language

    in a mask i select from a list_box one or more language and i send ad
    parameter to a query that extract the student that know all this
    language.

    i use something like

    table: Student,Languag e,Student- Language

    query:
    ....
    [Student- Language].Id_Lang
    LikeNz([Forms]![Student-Query-param]![Lang_l_box],"*")

    but if i select "ADA and C" the query report student that know :C or
    ADA or C and ADA.

    how i can do for got only the student that know "C *and* ADA"?.

    grazie.

  • ray@aic.net.au

    #2
    Re: Query with 1 or n parameter

    Hi maurizio,

    I think your query will be a bit more complex.

    It will have to look something like:

    Select StudentID from STUDENTS where
    StudentID IN
    (Select StudentID from STUDENT-LANGUAGE where LanguageID = "C")
    AND
    StudentID IN
    (Select StudentID from STUDENT-LANGUAGE where LanguageID = "ADA")

    Just add each new criteria as you iterate through the listbox.

    Ray


    maurizio.ferrac ini@gmail.com wrote:
    a student know one ore more programming language
    >
    in a mask i select from a list_box one or more language and i send ad
    parameter to a query that extract the student that know all this
    language.
    >
    i use something like
    >
    table: Student,Languag e,Student- Language
    >
    query:
    ...
    [Student- Language].Id_Lang
    LikeNz([Forms]![Student-Query-param]![Lang_l_box],"*")
    >
    but if i select "ADA and C" the query report student that know :C or
    ADA or C and ADA.
    >
    how i can do for got only the student that know "C *and* ADA"?.
    >
    grazie.

    Comment

    Working...