Parameter Query - from a range of numbers

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

Guest

I have a field called CertNum. Presently it has 243 numbers (records along
with related data) starting with number 2050. I want to be able to return
the "CertNums" and related table data for a range of numbers - ie I want
prompts for a begining number and an ending number and return say numbers
from 2075 thru and including 2175, again with related data.

I have tried Between [First Number:] And [Second Number:] as criteria for my
query. I am prompted correctly but I do not get the expected return. (When
I enter 2050 through 2070 I get 2050 through 2053 and that is it; when I
start with any number other than 2050 it returns nothing).

CertNum is a generated number of Long Intiger type. (CertNum is generated
by: =DMax("CertNum","Brick Info")+1 being placed as the default value in
the data input form).
 
The Number field of size Long Integer makes good sense, so perhaps Access is
misunderstanding the parameters.

In query design view, choose Parameters on the Query menu.
Type 2 rows into the dialog, and specify their data types:
[First Number:] Long
[Second Number:] Long

If that does not work, post the SQL statement (SQL View of the query) so we
can see if other joins or criteria are affecting the outcome.
 
Thanks . . . I followed your suggestion and looked at the code and saw my
mistake. In my haste I copied and renamed a previous query and did not look
closely at what I was doing - when I did I noticed I found a second criteria
(Date()) left over from my first query that drove my error. Once I corrected
that the Between [First. . .] And [Second . . .] worked fine. That is a
lesson I will remember . . . just slow down and if I am going to use a
shortcut examine it closely before proceeding.
 
Back
Top