Results 1 to 9 of 9
  1. #1
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31

    Date Formula in a Table

    I need help creating a formula/expression that will do the following.

    Will check yes/no box based on the following criteria



    1. If Box1 says yes
    2. If Box2 date is greater than current date

    anyone have any ideas?

  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,644
    Is Box1 a yes/no checkbox?

    Try:

    =IIf([Box1] AND [Box2]>Date(), True, False)
    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
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    Yes box 1 is a yes/no box.

  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,644
    Did the suggested expression work?
    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
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    The statement almost works, I think it needs to be an OR statement rather than an AND statement but the word OR wont work. Any Ideas?

  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,644
    OR should work.

    What do you mean OR won't work - what happens?
    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.

  7. #7
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    Well I got this forumla to work in the Form, but I cant get the answer to populate in the table that i need it to. Is that not possible?

  8. #8
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Typically, you do not want to store calculations at the Table level. Even though Access just recently starting letting you do this, most programmers avoid it, because it kind of goes against the rules of Relational Database theory, and is not compatible with other database programs (i.e. if you ever needed to convert the data table to SQL, you wouldn't be able to do it).

    As a general rule of thumb, anything which can be calculated should be done on the Query, Form, or Report level. There is seldom a good reason to store it at the Table level anyhow, as pretty much anything you can do with a Table (use as a Data Source, export, etc), you can also do with a Query.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    What JoeM said ...

    However, saving calculated data can sometimes be desirable and that requires code. I don't think in this case saving the calculated value is warranted.
    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: 7
    Last Post: 02-25-2014, 03:11 PM
  2. Replies: 3
    Last Post: 12-24-2013, 04:20 PM
  3. Replies: 5
    Last Post: 04-03-2012, 07:24 AM
  4. Writing a forumla for a report
    By sai_rlaf in forum Reports
    Replies: 2
    Last Post: 08-05-2011, 12:26 PM
  5. Replies: 1
    Last Post: 02-06-2011, 06:36 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