Simple Filter Question

  • Thread starter Thread starter Zane
  • Start date Start date
Z

Zane

I have a field with three options and I want a query that
has only one of these options. I tried: Like "entry1"
in the criteria field in the design veiw, but it isn't
working. Any help would be greatly appreciated.
 
What data type is your field? What are the three options?

simply entering

"entry1"

should work if one of your choices is "entry1". No need for 'like'.

Rick B

I have a field with three options and I want a query that
has only one of these options. I tried: Like "entry1"
in the criteria field in the design veiw, but it isn't
working. Any help would be greatly appreciated.
 
I actually have a couple of other filters on the query.
The SQL View looks like:

FROM [MAIN TABLE]
WHERE ((([MAIN TABLE].AREA) = "SEA") AND ((Month
([Modified Disclosure Date]))>=[StartMonth] And (Month
([Modified Disclosure Date]))<=[EndMonth])) OR ((([MAIN
TABLE].[Modified Disclosure Date]) Is Null) AND ((Month
([Disclosure Date]))>=[StartMonth] And (Month([Disclosure
Date]))<=[EndMonth]));

The first part is where I am trying to filter based on
the area, in this case SEA. The second is getting the
records beginning in one month and ending in another.
The way I enter the area in to my main table is based on
a combo box where the entries come from another table. I
don't think this should affect anything since it still
populates in the main table. Any help would be
appreciated. Thanks
 
If it is a combo box, your value is most likely not "sea" but 1 or 2 or 3.
Your combo box most likely pulls form a table with multiple values. for
example...

1 Texas
2 Arkansas
3 Florida

When you select an entry from the combo box, you are seeing the value in
column 2 (Texas, Florida, etc.) but the data the combo box uses is what is
in column one (1, 3, etc.)

So when you filter, you must look for the key, not the data.

Play with that and let me know.

Rick


I actually have a couple of other filters on the query.
The SQL View looks like:

FROM [MAIN TABLE]
WHERE ((([MAIN TABLE].AREA) = "SEA") AND ((Month
([Modified Disclosure Date]))>=[StartMonth] And (Month
([Modified Disclosure Date]))<=[EndMonth])) OR ((([MAIN
TABLE].[Modified Disclosure Date]) Is Null) AND ((Month
([Disclosure Date]))>=[StartMonth] And (Month([Disclosure
Date]))<=[EndMonth]));

The first part is where I am trying to filter based on
the area, in this case SEA. The second is getting the
records beginning in one month and ending in another.
The way I enter the area in to my main table is based on
a combo box where the entries come from another table. I
don't think this should affect anything since it still
populates in the main table. Any help would be
appreciated. Thanks
 
Actually the data is just the three values. In other
words the table for area isn't
1 Texas Texas
2 Arkansas it is actually Arkansas
3 Florida Florida

And I also use the combo box to enter text into the main
table. So if the user picks Texas, the word Texas will
appear in the main table. I don't know if this makes any
sense, but either way shouldn't my filter mentioned in
one of my earlier posts still work? Thanks

Zane

-----Original Message-----
If it is a combo box, your value is most likely not "sea" but 1 or 2 or 3.
Your combo box most likely pulls form a table with multiple values. for
example...

1 Texas
2 Arkansas
3 Florida

When you select an entry from the combo box, you are seeing the value in
column 2 (Texas, Florida, etc.) but the data the combo box uses is what is
in column one (1, 3, etc.)

So when you filter, you must look for the key, not the data.

Play with that and let me know.

Rick


I actually have a couple of other filters on the query.
The SQL View looks like:

FROM [MAIN TABLE]
WHERE ((([MAIN TABLE].AREA) = "SEA") AND ((Month
([Modified Disclosure Date]))>=[StartMonth] And (Month
([Modified Disclosure Date]))<=[EndMonth])) OR ((([MAIN
TABLE].[Modified Disclosure Date]) Is Null) AND ((Month
([Disclosure Date]))>=[StartMonth] And (Month([Disclosure
Date]))<=[EndMonth]));

The first part is where I am trying to filter based on
the area, in this case SEA. The second is getting the
records beginning in one month and ending in another.
The way I enter the area in to my main table is based on
a combo box where the entries come from another table. I
don't think this should affect anything since it still
populates in the main table. Any help would be
appreciated. Thanks

-----Original Message-----
What data type is your field? What are the three options?

simply entering

"entry1"

should work if one of your choices is "entry1". No need for 'like'.

Rick B

I have a field with three options and I want a query that
has only one of these options. I tried: Like "entry1"
in the criteria field in the design veiw, but it isn't
working. Any help would be greatly appreciated.


.


.
 
based on what you have said, Yes, I would think your original filter should
work.

Any MVP's out there know what is going on here?



Actually the data is just the three values. In other
words the table for area isn't
1 Texas Texas
2 Arkansas it is actually Arkansas
3 Florida Florida

And I also use the combo box to enter text into the main
table. So if the user picks Texas, the word Texas will
appear in the main table. I don't know if this makes any
sense, but either way shouldn't my filter mentioned in
one of my earlier posts still work? Thanks

Zane

-----Original Message-----
If it is a combo box, your value is most likely not "sea" but 1 or 2 or 3.
Your combo box most likely pulls form a table with multiple values. for
example...

1 Texas
2 Arkansas
3 Florida

When you select an entry from the combo box, you are seeing the value in
column 2 (Texas, Florida, etc.) but the data the combo box uses is what is
in column one (1, 3, etc.)

So when you filter, you must look for the key, not the data.

Play with that and let me know.

Rick


I actually have a couple of other filters on the query.
The SQL View looks like:

FROM [MAIN TABLE]
WHERE ((([MAIN TABLE].AREA) = "SEA") AND ((Month
([Modified Disclosure Date]))>=[StartMonth] And (Month
([Modified Disclosure Date]))<=[EndMonth])) OR ((([MAIN
TABLE].[Modified Disclosure Date]) Is Null) AND ((Month
([Disclosure Date]))>=[StartMonth] And (Month([Disclosure
Date]))<=[EndMonth]));

The first part is where I am trying to filter based on
the area, in this case SEA. The second is getting the
records beginning in one month and ending in another.
The way I enter the area in to my main table is based on
a combo box where the entries come from another table. I
don't think this should affect anything since it still
populates in the main table. Any help would be
appreciated. Thanks

-----Original Message-----
What data type is your field? What are the three options?

simply entering

"entry1"

should work if one of your choices is "entry1". No need for 'like'.

Rick B

I have a field with three options and I want a query that
has only one of these options. I tried: Like "entry1"
in the criteria field in the design veiw, but it isn't
working. Any help would be greatly appreciated.


.


.
 
Back
Top