Results 1 to 6 of 6
  1. #1
    prvnchdry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    3

    Question How can this excel formula be imitated in Access?


    I have the below formula in excel that needs to work in a new calculated field of Access 2010.

    =IF((ISBLANK(Mydate)),IF(Deadline date>TODAY(),"Not sent (Deadline approaching)", "Not sent (Past due)"),IF(Mydate<=Deadline date,"On time","Not on time"))

    Kindly help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If in a table Calculated field or in a textbox:
    IIf(IsNull([MyDate]), IIf([Deadline date]>Date(), "Not sent (Deadline approaching)", "Not sent (Past due)"), IIf([MyDate]<=[Deadline date], "On time", "Not on time"))

    If in a query:
    IIf([MyDate] Is Null, IIf([Deadline date]>Date(), "Not sent (Deadline approaching)", "Not sent (Past due)"), IIf([MyDate]<=[Deadline date], "On time", "Not on time"))
    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
    prvnchdry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    3
    Using this I get an error as "this expression.. cannot be used in a calculated column" . Am I going wrong somewhere?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not all expressions can be in a Calculated field. I did verify that the IIf() and IsNull() functions are available to Calculated column. However, I forgot to verify Date(). It is not available. Cannot do this calc in table. Do in query or textbox.
    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.

  5. #5
    prvnchdry is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    3
    Quote Originally Posted by June7 View Post
    Not all expressions can be in a Calculated field. I did verify that the IIf() and IsNull() functions are available to Calculated column. However, I forgot to verify Date(). It is not available. Cannot do this calc in table. Do in query or textbox.
    Hi again....Sorry but I am pretty new to MS Access and was comfortable with simple formulas in a calculated field but not sure how to proceed with query or a text box.... Any help in here would be much appreciated!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    In textbox ControlSource property but precede with = sign.

    In a query, review http://www.fontstuff.com/access/acctut02.htm
    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: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  3. set excel formula from access vba
    By trevor40 in forum Programming
    Replies: 16
    Last Post: 11-26-2014, 07:32 PM
  4. How to use this formula from Excel in Access?
    By jset818 in forum Queries
    Replies: 11
    Last Post: 10-16-2014, 03:32 PM
  5. Using an Excel Formula in Access
    By BEI77 in forum Access
    Replies: 6
    Last Post: 05-08-2014, 05:08 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