Results 1 to 2 of 2
  1. #1
    johnnythered is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Posts
    1

    Return multiple results based on a field

    Event# EID Arrived Time Code Cancelled Time
    F1001 1 611 12:00
    E1134 1 12:05 TRN
    F1002 2 611 17:50
    E1135 2 17:45 TRN
    F1003 3 18:00 321
    E1136 3 18:12 TRN
    F1004 4 03:33 321
    E1137 4 03:40 TRN

    I need to find all EIDs where the Code is 611 where an Event# starting with F was Cancelled along with the time of the cancellation. For these results I also need the Arrived Time for the Event# starting with E for that EID.

    For instance, a result I'm looking for would be:
    EID Event# (F) Cancelled Time Event# (E) Arrived Time
    1 F1001 12:00 E1134 12:05
    2 F1002 17:50 E1135 17:45

    For this example there would only be 2 rows returned.

    Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Try:

    SELECT Table1.[Event#], Table1.EID, Table1.ArrivedTime, Table1.Code, Table1.CancelledTime, Table1_1.ArrivedTime
    FROM Table1 AS Table1_1 INNER JOIN Table1 ON Table1_1.EID = Table1.EID
    WHERE (((Table1.[Event#]) Like "F*") AND ((Table1.Code)="611") AND (Not (Table1.CancelledTime) Is Null) AND (Not (Table1_1.ArrivedTime) Is Null));
    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: 3
    Last Post: 07-30-2015, 03:59 AM
  2. Return results based on a partial search
    By TimMoffy in forum Queries
    Replies: 2
    Last Post: 07-27-2012, 11:09 AM
  3. Replies: 9
    Last Post: 03-09-2012, 02:55 PM
  4. Replies: 2
    Last Post: 08-05-2011, 01:24 PM
  5. Replies: 5
    Last Post: 10-08-2009, 05:15 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