Transfer Excel If statement to Access expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shill777
    New Member
    • Jul 2014
    • 2

    Transfer Excel If statement to Access expression

    I have the following formula in Excel and I am trying to transfer the same formula into an expression builder in Access 2007. Does anyone know what the expression should look like in Access?

    =IF(LEFT(VATs!H 2,3)="L7R",VATs !E2&VATs!F2,IF( VATs!B2="",TRIM (VATs!E2),IF(VA Ts!B2<>"",TRIM( VATs!B2),"Not Rent")))
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    In Access, the IF function is IIF. The only other change you would have to make is to reference your column names instead of the Excel coordinates.

    Comment

    • shill777
      New Member
      • Jul 2014
      • 2

      #3
      I tried this to see if that if the first 3 letters of my data equal LR7 then I want it to combine the Deposit and Check field, if not bring over 0. And my results were all of the fields have 0 as the results.

      CDNumber: IIf(Left([VATs]![Document Number],3)="LR7",[Deposit] & [Check],"0")

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        [VATs]! was part of your excel reference. Not sure why you're continuing to use the excel reference.

        Comment

        Working...