Problem with parameter query using between []...

A

Alex Blanco

I am trying to build a parameter query for which I would enter two values and have all the values in between returned. For example, a list of numbers from 1 to 200.
On the query I have the following on the Criteria:

Between [Enter Product min number] And [Enter product max number] & "*"

So when I run the query first window pops up, I enter 100, then second one pops up, I enter 150 and after that I get a message saying that the expression is typed incorrectly or it is to complex.

Also, I am trying to get a query of the same kind where I can type on the parameter something like >100 to get all the numbers greater than 100. But that is definitely not working

HELP! Thank you!

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
O

Ofer Cohen

Between [Enter Product min number] And [Enter product max number] & "*"

The & "*" in the end of the criteria cause for this error, remove it and use

Between [Enter Product min number] And [Enter product max number]

the & "*" used for a wild card search

Where FieldName Like [Enter string] & "*"


----
Good Luck
BS"D


I am trying to build a parameter query for which I would enter two values
and have all the values in between returned. For example, a list of numbers
from 1 to 200.
On the query I have the following on the Criteria:

Between [Enter Product min number] And [Enter product max number] & "*"

So when I run the query first window pops up, I enter 100, then second one
pops up, I enter 150 and after that I get a message saying that the
expression is typed incorrectly or it is to complex.
Also, I am trying to get a query of the same kind where I can type on the
parameter something like >100 to get all the numbers greater than 100. But
that is definitely not working
 
J

John Spencer

First, what type of field are you looking at? Is the field a number field
or a text field that is storing number characters?

Also, you can't mix number data and string data in a between clause (which
adding the "*" at end of the between will probably do);

Try
Between [Enter Product min number] And [Enter product max number]

If your field is text, Access will change >100 to >"100" and return results
where the value in the field is "2" since "2" as a string is greater than
"100" as a string.

Either change the field type to a number field or convert the data to a
numeric value in the query.



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Gina Whipp

On the Between line get rid of the &"*", it should look like:
Between [Enter Product min number] And [Enter product max number]

On the query of the same kind where you type >100, is that a number field?
A little more detail might help to figure out why that one is not working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top