Re: help using a parameter in an 'In (...)' criteria

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

OK, I got it to work. Thanks!

I don't understand why my three other parameters are in square brackets in
the WHERE clause, but for the survey list parameter it's the field name that
is in square brackets? Hmm, now that I look at the SQL more closely I also
don't understand why in the SELECT clause the table/field are as
[Table]![Field] but in the WHERE they are as (Table.Field). Are those two
formats interchangeable? maybe that's where my confusion is coming from?

Here is my SQL:

PARAMETERS parSurveyList Text ( 255 ), parHerd Long, parPreDate DateTime,
parPostDate DateTime;
SELECT Sum([GroupLocation]![AdultUnknown]+[GroupLocation]![Unknown]) AS
[Unknown]
FROM Survey INNER JOIN GroupLocation ON Survey.Survey_ID =
GroupLocation.Survey_ID
WHERE (((GroupLocation.Herd_ID)=[parHerd]) AND ((InStr("," & parSurveyList &
",","," & [SurveyType] & ","))>0) AND ((GroupLocation.Date)>[parPreDate] And
(GroupLocation.Date)<[parPostDate]));


.



Relevant Pages

  • Re: SELECT FROM function in Access 2000
    ... >From clause - essentially as another table. ... The left and right square brackets are required, ... Roger dot Carlson at Spectrum-Health dot Org ... > resultset, then that resultset must be query-able again with a select. ...
    (microsoft.public.access.queries)
  • Re: having problems with mySQL commands
    ... they enter the survey answers. ... the manual that corresponds to your MySQL server version for the ... You will find that it does not take a WHERE clause. ... Arunabh Das Sharma ...
    (comp.lang.php)
  • Re: having problems with mySQL commands
    ... The id is used to check and see it user has a valid code ... enter the survey answers. ... the manual that corresponds to your MySQL server version for the right ... You can use WHERE clause in SELECTs and UPDATEs ...
    (comp.lang.php)
  • Re: Negate a regular expression
    ... Ken Foskey wrote: ... square brackets are a character class. ... I put that first and the exit statement in the else clause and it does ...
    (perl.beginners)
  • RE: Group By Question
    ... list, neither in the group by clause, I wonder why sql server is not giving ... If you want to filter the rows using WHERE clause, ... > results in which it will count the number of responses for a given survey. ...
    (microsoft.public.sqlserver.programming)