Welcome to SPN

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

Sign Up Now!

query for many different number

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

  1. annder

    annder
    Expand Collapse
    Guest

    I need to know how to query for many diffent numbers
    (like 30 random numbers) in my ticket # field
    not using- between "1500" and "7800" (in criteria line)
    also
    and not using criteria line: 1500
    then using the next line or: 1900
    then the next line : 2000
    and soforth
    this is actully almost what i need but it only lets me enter 9 different
    numbers i need to be able to use and unlimited number
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    I would create a table with one field where I will enter all the number I
    wont to have the resault for
    Then in the query add the criteria

    Select * From YourTableName Where FieldName In (Select FieldName From
    NewTableName) Or FieldName between "1500" and "7800"

    That way, if you need to add numbers or remove numbers, all you need is to
    add or delete to or from the table, without touching the query.
    Also, if you developing the system for someone, you can create a form where
    he can enter the values without beeing dependend on you.

    ==================
    One question, in the between criteria that you gave you had quote between
    the numbers which indicates on string type field, if that the case, to make
    the between work properly convert the text to number

    Select * From YourTableName Where FieldName In (Select FieldName From
    NewTableName) Or CLng(FieldName) between 1500 and 7800

    --
    Good Luck
    BS"D


    "annder" wrote:

    > I need to know how to query for many diffent numbers
    > (like 30 random numbers) in my ticket # field
    > not using- between "1500" and "7800" (in criteria line)
    > also
    > and not using criteria line: 1500
    > then using the next line or: 1900
    > then the next line : 2000
    > and soforth
    > this is actully almost what i need but it only lets me enter 9 different
    > numbers i need to be able to use and unlimited number
    >
     
  4. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    One more thing
    In the query, if you have more then one Or, you can put directly in the top
    criteria

    2000 Or 1000 Or 4000 ... Etc

    Or,
    In (2000 ,1000, 4000 ,444,655,777)


    --
    Good Luck
    BS"D


    "annder" wrote:

    > I need to know how to query for many diffent numbers
    > (like 30 random numbers) in my ticket # field
    > not using- between "1500" and "7800" (in criteria line)
    > also
    > and not using criteria line: 1500
    > then using the next line or: 1900
    > then the next line : 2000
    > and soforth
    > this is actully almost what i need but it only lets me enter 9 different
    > numbers i need to be able to use and unlimited number
    >
     
  5. annder

    annder
    Expand Collapse
    Guest

    Thank you very much the
    In (2000 ,1000, 4000 ,444,655,777)
    was exactly what i needed.

    "Ofer Cohen" wrote:

    > One more thing
    > In the query, if you have more then one Or, you can put directly in the top
    > criteria
    >
    > 2000 Or 1000 Or 4000 ... Etc
    >
    > Or,
    > In (2000 ,1000, 4000 ,444,655,777)
    >
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "annder" wrote:
    >
    > > I need to know how to query for many diffent numbers
    > > (like 30 random numbers) in my ticket # field
    > > not using- between "1500" and "7800" (in criteria line)
    > > also
    > > and not using criteria line: 1500
    > > then using the next line or: 1900
    > > then the next line : 2000
    > > and soforth
    > > this is actully almost what i need but it only lets me enter 9 different
    > > numbers i need to be able to use and unlimited number
    > >
     

Share This Page