Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: if statements in query expression

    Is it possible to put "if" statements in a a query in Access97? I have 1 field with a bunch of different dollar values. I'd like to setup an expression in the second column that says "if less than $10,000 and greater then $5000 then it will equal "2", if less than $20,000 and greater then $10,000 then it will equal "3" and so on. Is this possible or is there a completely better way of doing it?

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    Hi,

    Instead of using iif() function in queries (you can't use if statement in queries) you may code your own function to return the string you want. It is allowed to use your functions in queries.

    HTH, Igor

Posting Permissions

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