Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Parameter Query - from a range of numbers

Discussion in 'Information Technology' started by SIGS, Jul 28, 2006.

  1. SIGS

    SIGS
    Expand Collapse
    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).
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    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.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "SIGS" <SIGS@discussions.microsoft.com> wrote in message
    news:88928AEE-CC84-4C26-A479-4289276B3042@microsoft.com...
    >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).
     
  4. SIGS

    SIGS
    Expand Collapse
    Guest

    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.

    "SIGS" wrote:

    > 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).
    >
     

Share This Page