Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    DB88 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    110
    Got it to work!!!!!! I have one Query, InventoryQuery whose results are the field YearKey and Inv (inventory calculated using recursion)

    Inv:IIF([Procurement]![YearKey] = [StartYear]; [Procurement]![Acq]; [Procurement]![Acq] + [AttritionRate]*DLookUp("[Inv]", "InventoryQuery", "[Procurement]![YearKey]="&[Procurement]![YearKey]-1))

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Why the IIF? Is that an expression for an alias within your query?

  3. #18
    DB88 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    110
    IIF is an if/else statement. In recursion you need a base case/termination case. So, I say "if the year is the first year of the program then inventory is just that year's acquisition, else inventory is that year's acquisition + previous year's inventory*attrition"

    The expression in the IIF statement asks weither the record is my base case

    Does that answer your question?

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Yes it does, thank you. Glad you were able to get it all in one expression. Nice

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums