Results 1 to 10 of 10

Thread: SQL query

  1. #1
    Join Date
    Feb 2004
    Posts
    43

    Unanswered: SQL query

    Right -I need to specify more than one field in a single query -is this possible?

    If not-has anyone got a workround?

    Many Thanks-Please help

  2. #2
    Join Date
    Dec 2003
    Location
    Toronto, Ont. Canada
    Posts
    238

    Re: SQL query

    Originally posted by Oliver_No1
    Right -I need to specify more than one field in a single query -is this possible?

    If not-has anyone got a workround?

    Many Thanks-Please help
    Ummm... Huh??
    I musn't be understanding the question... I specify all kinds of fields in my queries... Can you explain a little further?

  3. #3
    Join Date
    Feb 2004
    Posts
    43
    Sorry

    I want a SINGLE query-

    The first design "column" needs to specify that it is getting its data from 18 different sources-as opposed to the single source that the user is normally allowed to specify. For example the field normally states "Field" to which i input Late 1-i actually need to query fields 1 through to 18.

    But in all other ways it needs to run as a single query-for example the user is asked ONE parameter question to gain the results.

    Hope this is clearer.

  4. #4
    Join Date
    Dec 2003
    Location
    Toronto, Ont. Canada
    Posts
    238
    Originally posted by Oliver_No1
    Sorry

    I want a SINGLE query-

    The first design "column" needs to specify that it is getting its data from 18 different sources-as opposed to the single source that the user is normally allowed to specify. For example the field normally states "Field" to which i input Late 1-i actually need to query fields 1 through to 18.

    But in all other ways it needs to run as a single query-for example the user is asked ONE parameter question to gain the results.

    Hope this is clearer.
    I'm sorry...
    I have never heard anyone use the term "SINGLE query" before...

    When you say column I think you're talking about a field...
    When you say 18 different sources, I don't know if you mean 1 field in 18 different tables/queries... or 18 different fields in one table/query (concatenated or summed or something?)?

    I'm lost... Wish I could help... Hopefully someone else will be able to...

  5. #5
    Join Date
    Feb 2004
    Posts
    43
    Sorry about the terminology.

    a normal -standard query.

    Getting the info from 18 fileds contained in 1 table.

  6. #6
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    I'm with Trudi on the confused bench (Must be a Toronto thing). Maybe you're looking for one form that can translate user input into data query requirements?
    All code ADO/ADOX unless otherwise specified.
    Mike.

  7. #7
    Join Date
    Nov 2003
    Posts
    267
    Let me see if I understand you

    You want a query that will have 18 different fields, but you want to search all fields for the same criteria you entered in the first column. Thus only having to enter a criteria once instead of 18 times, Correct?

    S-

  8. #8
    Join Date
    Feb 2004
    Posts
    43
    Yes Thats it!

  9. #9
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Props to sbaxter for decrypting the request

    You'll need to write a parameter query, invoke 17 ORs, and have the parameter be defined with the same text. You'll need to write this because the QBE grid doesn't have the capacity to OR 17 times. It can AND 17 times, however.

    WHERE (((tblItemInStores.Item) Like Chr(42) & [a] & Chr(42))) OR (((tblItemInStores.PriceCategory) Like Chr(42) & [a] & Chr(42)).....)

    the Chr(42)s are * and don't need to be used unless you are using the LIKE operator.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  10. #10
    Join Date
    Feb 2004
    Posts
    43
    Thank you very much.

    Thats exactly what i wanted!.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •