Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    My suggestion was to do a GROUP BY (aggregate) query that uses MLS or ID as the grouping criteria. Actually, group on LoanID of tblCashFlow and it is not necessary to include tblLoanGeneral in the query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    June,
    when you do a group by (aggregate)query, you cannot have the expression to sum up all of the fields in the same query. it tells you cannot have an aggregate function in the group by clause Expr1: Nz(Sum([Principal]+[Interest]+[fees]+[payoff]+[notesale]+[reonoi]))-Nz(Sum([priorliens]+[backtaxes]+[assetmgtfee]+[legalfc]+[loanadvances]+[reotaxins]+[reoothercost]+[brokerfees]+[ProfFeesOtherExp]))

  3. #18
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    Ok I think I might have figured it out... I just baskspaced out 'group By' below the expression. Im going to spot check and see what I come up with.
    Ill be back
    -Matt

  4. #19
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    Ok it works Thank you June and Rod for the help.
    Im sure we will run into each other again... Until that day, take care
    -Matt

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't put the Sum function in the expression. Instead of 'group by' below the expression, choose Sum. Group By should be under LoanID.

    I don't think the Nz as you are using will give desired results. Might need the Nz used on each term.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    June,
    The sum function produces the same error. I just put in the Total: expression, and it works. If you feel so inclined, I have another thread with a question that can be found here
    https://www.accessforums.net/access/...ort-27637.html
    If you want to help out, id appreciate it =]
    -Matt

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Glad it is working but seems odd to me. I will check out the other thread.

    You might want to remove the file from post if the data is real info.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Expr1: Nz(Sum([Principal]+[Interest]+[fees]+[payoff]+[notesale]+[reonoi]))-Nz(Sum([priorliens]+[backtaxes]+[assetmgtfee]+[legalfc]+[loanadvances]+[reotaxins]+[reoothercost]+[brokerfees]+[ProfFeesOtherExp]))
    June7 has pointed out that you should not put the Sum function in the expression. I however have a concern with the use of the Nz function. Should the expression not be

    NetIncome: Nz([Principal])+Nz([Interest])+Nz([fees])+Nz([payoff])+Nz([notesale])+Nz([reonoi])-Nz([priorliens])+Nz([backtaxes])-Nz([assetmgtfee])-Nz([legalfc])-Nz([loanadvances])-Nz([reotaxins])-Nz([reoothercost])-Nz([brokerfees])-Nz([ProfFeesOtherExp])

    I don't know what Access SQL does with 3+Null. Access mainstream certainly objects.

    Just noticed that June7 has made this point as well - sorry.
    Last edited by Rod; 08-24-2012 at 08:41 PM. Reason: Myopia

  9. #24
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    Hi all,
    So I removed the sum from the front and then made the group by sum. However I have one question. One of my assets shows 555,000 as the net income from the cashflow, however when it is ran in the query, it shows (119,000). Every other asset in our pool is correct except for this one. Any ideas?

  10. #25
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    No, I would have to examine the data and report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #26
    Mpike926's Avatar
    Mpike926 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Florida
    Posts
    43
    Ive narrowed it down to this.
    The cashflow is a continuous form limited at 60 and for some reason, the income for the one month isnt picked up and the -119k is actually expenses from the loan. however if i move the income of what ever it is, up or down a month it gets picked up and reflected. I find this strange because the query adds and subtacts the sum of all income and expenses, so you would think that whatever month the income was in it really wouldnt matter

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

Similar Threads

  1. Replies: 1
    Last Post: 11-20-2011, 12:11 PM
  2. Parameter Query on a calculated field
    By l3111 in forum Queries
    Replies: 5
    Last Post: 10-12-2011, 02:18 PM
  3. Update Query with a Calculated field
    By Lorlai in forum Queries
    Replies: 3
    Last Post: 09-21-2011, 10:57 AM
  4. union query with a calculated field
    By grad2009 in forum Queries
    Replies: 9
    Last Post: 03-31-2010, 04:50 PM
  5. Replies: 4
    Last Post: 03-05-2010, 09:56 PM

Tags for this Thread

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