Re: Reading Previous record of field and inserting it into current If Is Null??

Discussion in 'Microsoft Access Queries' started by Bob Barrows, Mar 19, 2012.

  1. Bob Barrows

    Bob Barrows Guest

    Perhaps:
    UPDATE tbltest as o
    SET Planned =
    (
    Select Planned FROM tbltest
    WHERE keyfield=
    (
    SELECT max(keyfield) FROM tbltest
    WHERE Planned is not null and keyfield<o.keyfield
    )
    )
    WHERE Planned Is Null

    likeyeah wrote:
    > Been having a play with a recordset method of doing this, practicing
    > with a test table. The code below picks up when it is null or not,
    > but getting errors trying to put in the previous value into the
    > current record, then moving on again.
    >
    > Also will need error trapping in case the first record is null..
    >
    > J
    >

    <snip>
     
    Bob Barrows, Mar 19, 2012
    #1
    1. Advertisements

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. Guest

    inserting a NULL value into a Date/Time field

    Guest, Sep 17, 2004, in forum: Microsoft Access Queries
    Replies:
    0
    Views:
    240
    Guest
    Sep 17, 2004
  2. Guest

    field Is Null/Is Not Null criterion and IIf function

    Guest, Dec 15, 2004, in forum: Microsoft Access Queries
    Replies:
    3
    Views:
    676
    Marshall Barton
    Dec 16, 2004
  3. Guest

    Compare current record to previous record

    Guest, Aug 15, 2005, in forum: Microsoft Access Queries
    Replies:
    4
    Views:
    1,030
    Guest
    Aug 16, 2005
  4. Luc Dansereau

    Query using the current record and the previous one

    Luc Dansereau, Nov 25, 2005, in forum: Microsoft Access Queries
    Replies:
    1
    Views:
    249
    Allen Browne
    Nov 25, 2005
  5. broogle

    Add Previous record to Current record

    broogle, Jun 20, 2006, in forum: Microsoft Access Queries
    Replies:
    3
    Views:
    299
    Guest
    Jun 21, 2006
  6. acccessaccess2003

    Inserting values from previous row into null cells

    acccessaccess2003, Apr 26, 2008, in forum: Microsoft Access Queries
    Replies:
    1
    Views:
    185
    John Spencer
    Apr 27, 2008
  7. DawnTreader

    How to get the previous, current and next values for a field

    DawnTreader, Nov 3, 2009, in forum: Microsoft Access Queries
    Replies:
    2
    Views:
    188
    DawnTreader
    Nov 4, 2009
  8. pjo
    Replies:
    3
    Views:
    17,225
    John W. Vinson
    Feb 12, 2010
Loading...