Entering Criteria to get desired results

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in my query titled "Grids Included". It contains a variety of
grids, separated by commas. Ex. "f39, f40, f41" or "g40, g41, g42". I want
to be able to just have a parameter that says "grid", where I can enter f40,
and the results pop up for f40. I need help in creating in expression that
will pull the f40 out of the entire "f39, f40, f41. Thanks in advance.
 
First, to directly answer your question, try a Like operator.

Like "*f40*"

This will return any record that has f40 somewhere in the list that is in
that field.

Next, it isn't good to store multiple values in the field. It would be
better to make another table and link that table on the ID field or the
table that has these records. In the second table you would have one record
for each of the entries you currently have in your field.

Example:
ID Grid
1 f40
1 f32
1 f41
2 f39
2 f40

By linking this Id field to the Id field of your current table you could use
a query to get the grids that a particular record contains.
 
Posting the query's SQL statement would help, but perhaps something like
this as the WHERE clause:

WHERE [Enter grid value:] IN ("f39","f40","f41","g40","g41","g42")
 
Back
Top