combo box query

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

Guest

I am try to query a combo box that has list values from Goal 1 to Goal 11.
When I put the following in:

Between Goal 1 and Goal 3

The data returned is Goal 1 and Goal 2 but also includes Goal 10 and 11.
What I want is to have only information on Goal 1 and Goal 2. Also when I
use the same to try and get the data from Goal 7 - Goal 11. It only comes
back with data from Goal 1 - Goal 7.

Could anyone please help me with this query as I am sure I am completely
doing it wrong. Thanks in advance.
 
BETWEEN can only be used with numbers or dates, not with strings.
Well you can use it with strings but you will get what you described, it is
comparing them as strings, character by character and you got the correct
result.

Dorian
 
What would be the correct way to do it?

mscertified said:
BETWEEN can only be used with numbers or dates, not with strings.
Well you can use it with strings but you will get what you described, it is
comparing them as strings, character by character and you got the correct
result.

Dorian
 
I think I understand that you have a field (don't know what it is) that
contains data that looks like "Goal 1", "Goal 2", "Goal 3", "Goal 4",
...."Goal 11". Does this field contain anything else? If not, the word
"Goal" is redundant. If so, I would recommend modifying the structure of the
table to contain threefields (an ID field, one that has the string portion
"Goal"..., the other that has the numeric value). Then, if you want Between
"Goal 1 and Goal 7" you would write the query as something like:

WHERE [SomeField] = "Goal" AND ([NumericField] BETWEEN 1 and 7)

HTH
Dale
 
Back
Top