Query Calculated field question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cardinal

    #1

    Query Calculated field question

    I'm trying to create a calculation in a query in Access 2003 and not
    having much success. Basically, I want it to look at two fields and
    place the lower amount of the two fields into the calculated field.
    This is what I'm using with no luck. Can anyone tell me what I should
    be using instead? Thank you very much.

    What isn't working:
    Ending Amt: if([Amt by Part]<[Avail Bal],[Amt by Part],[Avail Bal])

  • guido via AccessMonster.com

    #2
    Re: Query Calculated field question

    Your if statement is missing an 'i'. It should be "iif" not "if".

    Cardinal wrote:
    >I'm trying to create a calculation in a query in Access 2003 and not
    >having much success. Basically, I want it to look at two fields and
    >place the lower amount of the two fields into the calculated field.
    >This is what I'm using with no luck. Can anyone tell me what I should
    >be using instead? Thank you very much.
    >
    >What isn't working:
    >Ending Amt: if([Amt by Part]<[Avail Bal],[Amt by Part],[Avail Bal])
    --
    Message posted via AccessMonster.c om


    Comment

    • fredg

      #3
      Re: Query Calculated field question

      On 12 Apr 2007 11:01:07 -0700, Cardinal wrote:
      I'm trying to create a calculation in a query in Access 2003 and not
      having much success. Basically, I want it to look at two fields and
      place the lower amount of the two fields into the calculated field.
      This is what I'm using with no luck. Can anyone tell me what I should
      be using instead? Thank you very much.
      >
      What isn't working:
      Ending Amt: if([Amt by Part]<[Avail Bal],[Amt by Part],[Avail Bal])
      Statements like 'not having much success' gives us no useful
      information to help you with.
      What happens?
      Wrong data is returned, #error shows? Access crashes? What?

      I see an error. But it might be just an error in your typing this
      message.

      Change If to IIf.
      Ending Amt: IIf([Amt by Part]<[Avail Bal],[Amt by Part],[Avail Bal])
      --
      Fred
      Please respond only to this newsgroup.
      I do not reply to personal e-mail

      Comment

      Working...