user input min/max error

  • Thread starter Thread starter JOHN
  • Start date Start date
J

JOHN

MVP,
First off thanks for you great help yeasterday!
today i have a new problem. i have a Querie with a
calsulated colum
"Days Pack Out: Date()-[Pack Out]"
that works great to i added user input to narrow down the
search alittle. so in the Criteria: in design view i
entered
"Between [Enter minimum days pack out] And [Enter maximim
days pack out]"
If the user enters values of 10 as min and 15 as max the
querie will show values of 10-15
THE PROBLEM....the Querie will also show values starting
with numbers from 10-15 suck as values from 100-150.
so what is happening here and how do i fix it?
Thanks in advance for you help.
JOHN
 
It looks like the query is considering your Days Pack Out and/or the two
parameters as text. You can force it to do a numeric compare by explicitly
declaring the parameters as Integer (choose Parameters from the Query menu)
and by forcing a convert of Days Pack Out:

Days Pack Out: CInt(Date() - [Pack Out])

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top