quick query question

Discussion in 'Microsoft Certification' started by John, Nov 11, 2009.

  1. John

    John Guest

    I have a query that I am trying to run, but it is not giving me any results
    at the end of teh query I say .... where (tblManifest.Comment = 'AP
    TRANSPORT') I get zero results, but when I say ....where where
    (tblManifest.Comment = 'RDF') it works just fine. I'm sure it has to do
    with the space in the name. I also know that it would show results.

    Thanks
    John, Nov 11, 2009
    #1
    1. Advertising

  2. John

    John Guest

    also, how would i do it for the query to display results from both?
    John, Nov 11, 2009
    #2
    1. Advertising

  3. "John" <> wrote in message
    news:...
    >I have a query that I am trying to run, but it is not giving me any results
    > at the end of teh query I say .... where (tblManifest.Comment = 'AP
    > TRANSPORT') I get zero results, but when I say ....where where
    > (tblManifest.Comment = 'RDF') it works just fine. I'm sure it has to
    > do
    > with the space in the name. I also know that it would show results.


    If the actual database column value has a space (and only one space), then
    'AP TRANSPORT' should be matched.

    The query engine recognizes spaces as spaces.

    To test the query, you could use wildcard replacement for the space,
    'AP%TRANSPORT', which would then pull any value starting with "AP" and
    ending with "TRANSPORT" and you could observe the actual value(s) in the
    table and match your final query appropriately.


    --
    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)

    My Blog: http://onsitechsolutions.spaces.live.com
    Microsoft WSUS Website: http://www.microsoft.com/wsus
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin
    Lawrence Garvin [MVP], Nov 11, 2009
    #3
  4. "John" <> wrote in message
    news:...
    > also, how would i do it for the query to display results from both?



    WHERE tblManifest.Comment = 'AP TRANSPORT' OR tblManifest.Comment = 'RDF'

    alternatively you could provide a list

    WHERE tblManifest.Comment IN ('AP TRANSPORT', 'RDF')


    One other note: Usually a 'Comment' field contains extensive amounts of
    text, not discrete string values. Note that you cannot use a WHERE = or
    WHERE IN filter to search for occurrences of substrings in a Comment file,
    unless you appropriately surround the substring definition with wildcards,
    so WHERE tbl.Manifest.Comment = '%AP TRANSPORT%' would match the occurrence
    of the string 'AP TRANSPORT' in the Comment field.

    Beyond that explanation, for further assistance with developing queries, I
    suggest you seek out an Access or SQL Server Programming forum, rather than
    this Microsoft Certification forum.

    --
    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)

    My Blog: http://onsitechsolutions.spaces.live.com
    Microsoft WSUS Website: http://www.microsoft.com/wsus
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin
    Lawrence Garvin [MVP], Nov 11, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob

    Quick printer query

    Bob, Jul 27, 2003, in forum: Computer Support
    Replies:
    2
    Views:
    460
    trout
    Jul 27, 2003
  2. Croos Bustamunky

    Quick Restore for a Compaq not so quick!

    Croos Bustamunky, May 15, 2004, in forum: Computer Support
    Replies:
    2
    Views:
    5,613
    Ryan 8088
    May 15, 2004
  3. Ol' Bab

    PanasonicBQ390 "quick" charger - How quick?

    Ol' Bab, Jan 17, 2004, in forum: Digital Photography
    Replies:
    1
    Views:
    487
    Dave Martindale
    Jan 17, 2004
  4. Replies:
    4
    Views:
    469
    George K
    Nov 20, 2006
  5. ~misfit~

    Quick question, hopefully quick answer.

    ~misfit~, Dec 28, 2004, in forum: NZ Computing
    Replies:
    114
    Views:
    2,351
    Troglodyte
    Jan 6, 2005
Loading...

Share This Page