Results 1 to 3 of 3
  1. #1
    Phillipc1 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2023
    Posts
    13

    Issue with conditional formatting for date


    Hello All!

    I am having an issue where I am wanting my report to highlight all expired dates and any dates within 7 days of now. However, my formatting is returning all dates back highlighted. What am I doing wrong?
    Attached Thumbnails Attached Thumbnails Formatting Output.png   Formatting Rule.png  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Rule works for me. Although, I would probably use Date() instead.

    However, your field looks like a text field not a date/time type. In which case the expression will not work because field does not contain a true date value, just a string of characters. Sometimes Access will do implicit data conversion but not in this case.

    Either change the field type in table or deal with the data conversion (same goes for DOTDate). Instead of Field Value Is, use Expression Is and try:

    CDate([ExpirationDate])<= Date() + 7
    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
    Phillipc1 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2023
    Posts
    13
    Awesome, I utilized the CDate expression and that worked. I appreciate it!

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

Similar Threads

  1. Mysterious intermittent Conditional Formatting issue
    By Allen Sundholm in forum Forms
    Replies: 4
    Last Post: 08-05-2019, 05:28 AM
  2. Date Formula in Conditional Formatting
    By assi11 in forum Queries
    Replies: 3
    Last Post: 11-14-2018, 02:12 AM
  3. Replies: 4
    Last Post: 01-31-2014, 06:57 PM
  4. Conditional Formatting Issue
    By RachelBedi in forum Access
    Replies: 1
    Last Post: 10-19-2012, 05:34 PM
  5. Date Conditional Formatting
    By f15avionics in forum Access
    Replies: 3
    Last Post: 09-21-2012, 04:45 AM

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