Results 1 to 2 of 2
  1. #1
    Gilbert is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    1

    finding the before sequence number

    Hi I have a question not sure if possible. I need to find the before sequence number based on a sequence number provided. I have a table A. Which has a 3 digit tick number and I've table B which Also has a 3 digit tick number. What I need is to look in table A with Ticket number of 103 and look into table B an Id that last tick associated with 103 was 100 based off table B

    For example


    Table A


    machine Tick.
    M1. 104
    M2. 108
    M3. 105

    table B
    machine. tick
    m6. 167
    m1. 100
    m2. 106
    m3. 104

    output
    machine. Tick 1. Tick2
    M1. 100. 104
    M2. 106. 108
    M3. 104. 105


    thanks for your assistance

  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,929
    You reference 103 in your narrative but there is no 103 in the sample data. Did you mean 104?

    Machine ID is not unique in Table B?

    Maybe:

    SELECT machine, Tick, DMax("Tick", "TableB", "machine='" & [machine] & "' AND Tick<" & [Tick]) As TickB FROM TableA;
    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. Show next number in sequence
    By cbrsix in forum Programming
    Replies: 1
    Last Post: 08-15-2013, 04:09 PM
  2. Replies: 3
    Last Post: 02-01-2013, 07:09 PM
  3. Find First number in sequence of numbers
    By losstww in forum Queries
    Replies: 4
    Last Post: 11-16-2012, 02:44 PM
  4. Enter new number in sequence in PO
    By tchirpich in forum Access
    Replies: 30
    Last Post: 12-30-2011, 11:24 AM
  5. Replies: 2
    Last Post: 06-11-2011, 10:39 PM

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