Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Kent, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AND operator within IIF (Access '97)

    Oddly enough this is the 1st time I have needed to use this, but I'm obviously not quite there.

    Basically I wish to do an 'If Field1 = 112 and Field2 > 1998,then,else' - as an expression in a query.

    This is what I have...I've based this on my excel knowledge. It doesn't like the AND

    IIF(AND([SYN]=112,[YOA]>1998),490,112)

  2. #2
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AND operator within IIF (Access '97)

    Try
    IIf([SYN]=112 And [YOA]>1998,490,112)
    Paul

  3. #3
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Kent, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AND operator within IIF (Access '97)

    That worked perfectly thanks.

    Why on earth does Excel work in a different manner - you'd think there would be some standardization!!

    Bye - and i'll take my soap box with me too!!

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AND operator within IIF (Access '97)

    Excel does its own thing. Access is a bit different from other Office apps as well. Put them together and you get total confusion. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •