Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    1

    Question Unanswered: Calculating with Previous Record

    I am trying to find a way to calculate 2 numbers in which one of them are in the previous record, but only when the day is sunday.

    An example database is attached and located on http://allenellison.net/db1.mdb



    Expr1 . . . . . Expr2 . . . Nat. Phnlst . Expr3 .DayofWeek . % Successful
    9/2/2004 . . . Nationals . . 17593 . . . 207 . . Thursday .. . . 98.82%
    9/5/2004 . . . Nationals . . 110 . . . . . 68 . . . Sunday . . . . . 38.18%
    9/9/2004 . . . Nationals . . 17473 . . . 147 . . Thursday .. . . 99.16%
    9/16/2004 . . Nationals . . 17554 . . . 206 . . Thursday .. . . 98.83%
    9/19/2004 . . Nationals . . 106 . . . . . 78 . . . Sunday . . . . . 26.42%
    9/23/2004 . . Nationals . . 17599 . . . 383 . . Thursday .. . . 97.82%
    9/30/2004 . . Nationals . . 17375 . . . 148 . . Thursday .. . . 99.15%
    9/12/2004 . . Nationals . . 298 . . . . . 157 . . Sunday . . . . . 7.32%

    This example is not calculating the Sunday % Successful as needed. The "Sunday" day of the week needs to be calculated with the previous "Nat. Phnlst" value. The corrected example is show below.


    Expr1 . . . . . Expr2 . . . Nat. Phnlst . Expr3 .DayofWeek . % Successful
    9/2/2004 . . . Nationals . . 17593 . . . 207 . . Thursday . . . .98.82%
    9/5/2004 . . . Nationals . . 110 . . . . . 68 . . . Sunday . . . . 99.61%
    9/9/2004 . . . Nationals . . 17473 . . . 147 . . Thursday .. . . 99.16%
    9/16/2004 . . Nationals . . 17554 . . . 206 . . Thursday .. . . 98.83%
    9/19/2004 . . Nationals . . 106 . . . . . 78 . . . Sunday . . . . 99.56%
    9/23/2004 . . Nationals . . 17599 . . . 383 . . Thursday .. . . 97.82%
    9/30/2004 . . Nationals . . 17375 . . . 148 . . Thursday .. . . 99.15%
    9/12/2004 . . Nationals . . 298 . . . . . 157 . . Sunday . . . . 99.10%



    If anyone can help with this, it is more than greatly appreciated. This can be done with a script, expression, or whatever is neccessary other than using an outside app. We are trying to keep everything within a single database.
    Thanks
    Attached Files Attached Files
    Last edited by allene; 10-02-04 at 16:32.

  2. #2
    Join Date
    Oct 2004
    Posts
    57
    did you ever figure this one out...or does anyone have ideas?

  3. #3
    Join Date
    Oct 2004
    Posts
    57
    did you ever figure this one out...or does anyone have ideas?

  4. #4
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    You need to use a calculated column in your query to fetch the previous records value. The easiest way to do this is the Dlookup function (see Access help on how to use it).

    Regards
    Justin

Posting Permissions

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