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:
    222
    Guest
    Sep 17, 2004
  2. Guest

    Compare current record to previous record

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

    Query using the current record and the previous one

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

    Add Previous record to Current record

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

    Inserting values from previous row into null cells

    acccessaccess2003, Apr 26, 2008, in forum: Microsoft Access Queries
    Replies:
    1
    Views:
    158
    John Spencer
    Apr 27, 2008
Loading...

Share This Page