Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    25

    Unanswered: Could any one explain the Query?

    could explain me how this query works especially the Where clause where we use the forms as i am trying some new stuff here and ui do not understand how it works , i would appreciate your help greatly

    SELECT COUNT(*)
    FROM tblintstudents
    WHERE (tblintstudents.Citizen IN
    (SELECT DISTINCT tblRegions.CountriesInRegion
    FROM tblRegions
    WHERE (tblRegions.GlobalRegion = [Forms]![frmRegGlobal]![txtGlobalReg] )
    )
    );

    thanks
    regards
    srinivas somanchi

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Psuedo code:

    SELECT count of students
    FROM student table
    WHERE students country is in a list of countries FROM the Regions table WHERE the Global Region field in the Regions table = the current value of the txtbox named "txtGlobalReg" on the form "frmRegGlobal"

  3. #3
    Join Date
    Mar 2004
    Posts
    10

    Re: Could any one explain the Query?

    Originally posted by somanchivasu
    could explain me how this query works especially the Where clause where we use the forms as i am trying some new stuff here and ui do not understand how it works , i would appreciate your help greatly

    SELECT COUNT(*)
    FROM tblintstudents
    WHERE (tblintstudents.Citizen IN
    (SELECT DISTINCT tblRegions.CountriesInRegion
    FROM tblRegions
    WHERE (tblRegions.GlobalRegion = [Forms]![frmRegGlobal]![txtGlobalReg] )
    )
    );

    thanks
    regards
    srinivas somanchi
    The "WHERE" is looking for the value in the text box <txtGlobalReg> from the form <frmRegGlobal>, and the query will only return values where the field <GlobalRegion> from the table <tblRegions> equals the same value as in the text field of the form.

  4. #4
    Join Date
    Mar 2004
    Posts
    25
    thanks for all the immediate response now iam clear and i can write some of my own.
    thank you very much

Posting Permissions

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