Results 1 to 8 of 8
  1. #1
    Essmoll is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    4

    How do I express this formula?

    How do I express this excel formula so that access can understand it.


    =IF(AND(LEFT(C1;2)="no";D1=4525);2001;D1)

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Maybe:

    =IIf(LEFT([fieldname1],2)="no" AND [fieldname2]=4525, 2001, [fieldname2])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Apr 2017
    Posts
    1,679
    =IIif(Left(Your1stValue;2)="no" And Your2ndValue=4525;2001;YourReturnValue)

  4. #4
    Essmoll is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    4
    That's what I tried but it gives me an error on all posts where filedname 1 is "NO".

    Quote Originally Posted by June7 View Post
    Maybe:

    =IIf(LEFT([fieldname1],2)="no" AND [fieldname2]=4525, 2001, [fieldname2])

  5. #5
    Essmoll is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    4
    But I can't get the return value correct from the 2nd value entry.

    Quote Originally Posted by ArviLaanemets View Post
    =IIif(Left(Your1stValue;2)="no" And Your2ndValue=4525;2001;YourReturnValue)

  6. #6
    Join Date
    Apr 2017
    Posts
    1,679
    In case you have Your1stValue starting with either "no" or "NO"
    =IIif(UPPER(Left(Your1stValue;2))="NO" And Your2ndValue=4525;2001;YourReturnValue)

    But I can't get the return value correct from the 2nd value entry
    In what way "not correct"?
    The only reason for 2nd condition not working properly can be the 2nd value being text instead number.

    Or is the value for Your2ndValue not an integer? When this is the case, then
    =IIif(UPPER(Left(Your1stValue;2))="NO" And Int(Your2ndValue)=4525;2001;YourReturnValue)

  7. #7
    Essmoll is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Nov 2017
    Posts
    4
    I think that was actually it! I had the data as text. It works now. Many thanks! :-)

    Quote Originally Posted by ArviLaanemets View Post
    In case you have Your1stValue starting with either "no" or "NO"
    =IIif(UPPER(Left(Your1stValue;2))="NO" And Your2ndValue=4525;2001;YourReturnValue)


    In what way "not correct"?
    The only reason for 2nd condition not working properly can be the 2nd value being text instead number.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Access in not case sensitive by default. UPPER() function should not be necessary.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 5
    Last Post: 11-26-2016, 10:10 AM
  2. Query, maybe Report, I'm not sure how to express it. lol
    By Andrea Buckridge in forum Queries
    Replies: 3
    Last Post: 01-08-2016, 07:11 PM
  3. Formatting field to express months
    By sgarfunkel in forum Database Design
    Replies: 1
    Last Post: 09-18-2013, 11:09 AM
  4. Access 2010 to sql 2012 express
    By danieltaylor in forum SQL Server
    Replies: 3
    Last Post: 11-21-2012, 03:20 AM
  5. Using Access and Outlook Express together
    By Alexross93 in forum Misc
    Replies: 1
    Last Post: 05-18-2012, 06:16 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
  •  
Other Forums: Microsoft Office Forums