Results 1 to 4 of 4
  1. #1
    vickan240sx is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    34

    Please help with this formula.

    Hi,



    I'm unable to get this formula to work.

    Code:
     =Count(IIf(([LoanOperationsTrackingLog]![NewRenewalExtensionModification]="New" And [LoanOperationsTrackingLog]![LoanTypeCodeLDD]="Consumer - Non TCD" And Month([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Forms]![LDDProductionRptDateSelection]![Month] And Year([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Forms]![LDDProductionRptDateSelection]![Year]),0))
    When I use just the month field, it works and vice versa for the year field. However, when I try to use both at the same time, i get an error.

    Any help is greatly appreciated.

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    What is the error?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    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.

  3. #3
    vickan240sx is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    34
    The error I get on my report just says #Error. I can't attach the database, because I have about 18 tables and about 50 forms that would need to be cleaned up prior to attaching it; the database is also 7mb too.

    Code:
    =Count(IIf(([LoanOperationsTrackingLog]![NewRenewalExtensionModification]="New" 
    And [LoanOperationsTrackingLog]![LoanTypeCodeLDD]="Consumer - Non TCD" 
    And Month([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Forms]![LDDProductionRptDateSelection]![Month] 
    And Year([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Forms]![LDDProductionRptDateSelection]![Year]),0))
    The breakdown of my code is as follows:

    I'm trying to count the number of occurrences of certain records meeting all the criteria:

    1) Month = Month input into search form (I input the #9)
    2) Year = Year input into search form (I input #2012)
    3) Criteria 1 = New
    4) Criteria 2 = Consumer - Non TCD

  4. #4
    vickan240sx is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    34
    I figured it out with your help from a related thread.

    Code:
    =Count(IIf(Month([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Month] 
    And Year([LoanOperationsTrackingLog]![LDDLogProcessingDateTime])=[Year] 
    And [LoanOperationsTrackingLog]![LoanTypeCodeLDD]="Consumer - Non TCD",
    [LoanOperationsTrackingLog]![NewRenewalExtensionModification]="New"))
    Thank you x2!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Formula
    By Ray67 in forum Queries
    Replies: 53
    Last Post: 08-09-2012, 01:56 AM
  2. need a formula please
    By jimbob90 in forum Queries
    Replies: 1
    Last Post: 08-01-2012, 06:56 PM
  3. Formula mod help
    By jcaptchaos2 in forum Access
    Replies: 2
    Last Post: 04-25-2011, 02:55 PM
  4. SQL Formula to Sum Itself
    By Scorpio11 in forum Access
    Replies: 1
    Last Post: 02-19-2011, 11:22 AM
  5. Formula
    By hschrunk in forum Access
    Replies: 3
    Last Post: 05-18-2010, 01:40 PM

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