Results 1 to 3 of 3

IIF(AND formula

  1. #1
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108

    IIF(AND formula

    Afternoon all,

    I'm trying to find out what the Access equivalent is of the Excel "IF(And(" formula. To elaborate on my question; I have a number of mailbox's in my database (you may of seen my other post about incremental's) and I need to split them out... As an example I will need to find Mailbox's between 1GB and 2GB. I've now split the full name of the text into just a number (e.g. 1, 1.456, 1.764) so I know need a formula to return what I want... In Excel I would do this...


    Code:
     IF(And([columnname]>1,[columnname]<2),"True","False")
    is there a equivalent in Access? The only thing even remotely close is the AND function outside of an IIF (below) which isn't what I want as i'll have to create multiple queries.

    Code:
     SELECT * FROM Persons
    WHERE FirstName='Tove'
    AND LastName='Svendson' 


  2. #2
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,436
    Change your formula to =IIF([columnName]>1 and [columnName]<2,"True","False")

    Syntax is slightly different. You need to spell out each criteria and IF is IIF

    Look here for full explanation.

    http://www.techonthenet.com/access/f...vanced/iif.php

    Same syntax when using OR in an IIF statement.

  3. #3
    dr4ke is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    108
    Thank you =)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Q: Help with a formula
    By TroxlSha in forum Access
    Replies: 3
    Last Post: 10-12-2012, 08:50 AM
  2. Please help with this formula.
    By vickan240sx in forum Access
    Replies: 3
    Last Post: 09-17-2012, 03:44 PM
  3. Formula
    By Ray67 in forum Queries
    Replies: 53
    Last Post: 08-09-2012, 01:56 AM
  4. need a formula please
    By jimbob90 in forum Queries
    Replies: 1
    Last Post: 08-01-2012, 06:56 PM
  5. Formula mod help
    By jcaptchaos2 in forum Access
    Replies: 2
    Last Post: 04-25-2011, 02:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums