• IIF clause on a report (Access 2000)

    Author
    Topic
    #441812

    I have an unbound control on a report called SalePrice.I also have 3 controls called UnitPrice , Grossprice and size. I want to build an IIF clause with the fooloiwng condition : if size = 205 or 180 then SalesPrice = grossprice Else SalePrice = UnitPrice.How can i do that ?

    Viewing 0 reply threads
    Author
    Replies
    • #1061719

      In the control source for Sale Price put this:

      = iif(([Size]=250) or ([Size]=180),[GrossPrice],[UnitPrice])

      • #1061728

        Thank you for the reply.But i get the error “extra ) in the query expression” ?

        • #1061729

          Check your expression carefully. Did you notice that there are 2 opening parentheses (( after IIf in the expression John posted?

          You can also use

          = IIf([Size]=250 Or [Size]=180,[GrossPrice],[UnitPrice])

          • #1061731

            Please do apologize me ! The expression works ! When i copied your expression i forgot to copy the = sign and hence the error Now it is Ok !!!!
            Please do apologize me and thank you !!!

      • #1061730

        Please do apologize me ! Your expression works ! When i copied your expression i forgot to copy the = sign and hence the error ? Now it is Ok !!!!
        Please do apologize me and thank you !!!

        • #1061733

          The IIF clause works,but i get results with more decimal places than 2, when i try to format the control,the results are not seen any more.If i place the decimal places to 2, this has no effect.Therefore i wll try another approach,
          but i think i will have to send another thread

    Viewing 0 reply threads
    Reply To: IIF clause on a report (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: