Results 1 to 2 of 2
  1. #1
    sarnie83 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2014
    Location
    Southsea, UK
    Posts
    1

    Select statement to return specific data from another column?

    Hello



    I was just wondering if this is a possibility to do in one query or if it has to be run from a number of different queries.

    I am currently developing a database from scratch for work (with very little Access experience).

    The current query I am trying to run, is linked to a number of tables with different information.

    What I am trying to do primarily is link stock to a specific "Host Name", "Serial Number" and "Part Description".

    In the "Host Name" there is for example - A1-TX1-10001, B1-TX2-10001, C1-TX3-10001 - The latter part of the name is a unique identifier number. The first part is the compartment in which the "stock" sits. So you may have all three components (A1-TX1, B1-TX2, C1-TX3) linked to the same unique identifier (10001 for example)

    The serial numbers naturally are different for every single one and of course the serial numbers are linked to the "Part Description" - which will read something like....."C1-TX3 Transmitter", "B1-TX2 Combiner" etc.....

    When I run the query like this the Host Name (which is also linked to the unique identifier on its own (10001) it returns everything under "A1-TX1-10001"

    What I would ideally like to do is write a statement so that if the "Part Description" contains "A1-TX1" it will only return rows that contain "A1-TX1" in the Host Name and the same for "B1-TX2" and "C1-TX3" in the same query.

    Is there a way to do this?

    If "Host Name" contains "A1-TX1" to return "Part Description" to contain "A1-TX1"

    Sorry I hope I've included enough information in this and it makes enough sense???

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Doesn't quite make sense to me.

    To filter records for a particular "Part Description":

    SELECT * FROM table WHERE HostName LIKE "*A1-TX1*";
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 02-20-2014, 02:34 PM
  2. Replies: 5
    Last Post: 09-23-2013, 02:55 PM
  3. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  4. IIF statement to select proper column data
    By lrydbom15 in forum Queries
    Replies: 3
    Last Post: 01-31-2012, 09:04 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums