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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
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:
    262
    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:
    868
    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,117
    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:
    300
    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:
    404
    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:
    258
    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:
    280
    DawnTreader
    Nov 4, 2009
  8. pjo
    Replies:
    3
    Views:
    20,219
    John W. Vinson
    Feb 12, 2010
Loading...