Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2014

    Unanswered: Comparation between record (row)

    Hi dB Experts,

    I have an Access/query databases with structure like below table :

    item Post batc Comparation Result
    A-100 1/1/2014 4100 ?
    A-100 1/2/2014 4101 ?
    A-100 1/3/2014 4102 ?
    A-100 1/4/2014 4101 ?
    A-100 1/5/2014 4103 ?
    A-100 1/6/2014 4100 ?
    B-101 1/1/2014 4108 ?
    B-101 1/1/2014 4107 ?
    B-101 1/2/2014 4107 ?

    What I want to do is to compare between previous row and current row (record). When the value of the current row is smallest than the previous row, the result will be "Jumping".
    I have no problem to running this role in Excel Formula by put =IF(C2<C1,"Jumping","OK").

    Anybody know the solution maybe using the query ?
    Waiting kind feedback from you all.


  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    databases have no concept of order or sequence, UNLESS you explcitly define one.
    what Im not sure about is what the desired outcome is. perhaps you coudl add what you want to see given the dataset you've provided.

    im sure its possible using a join on the same table, but I don't know what criteria you need for that JOIN
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    This would allow you to get the previous value on the same line for comparision:

    Microsoft Access tips: Subquery basics

Posting Permissions

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