Results 1 to 7 of 7
  1. #1
    jhallcb is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2015
    Posts
    9

    Filter overdue dates

    Hi guys,
    Happy with filtering on load but struggling to get the filter right...

    Have a report that i need to show only records That are over 45 days old, tried a few different formulas but non seem to work. Anyone offer any help?

    Using access 2007, uk time zone

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    How about showing us your related code?

  3. #3
    jhallcb is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2015
    Posts
    9
    Thanks for the reply ☺
    Using the filter property rather than vba, tried a few things along the lines of:
    =DATEADD(day,-45,Date)
    Date field is simply called date and i hve double checked it is formatted as date/time also.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    What is day?
    Date is a reserved word in Access. Reserved words list

    In plain English you are trying to identify records where

    PaymentDueDate is more than 45 days old, or
    The difference(in days) between PaymentDueDate and Today is > 45

    Research the syntax and samples of Access functions here
    Don't overlook Google or Bing when searching for info.

  5. #5
    jhallcb is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2015
    Posts
    9
    Okay so ive renamed the field from date and change day for d or dd but it keeps saying i have a missing operator?? Where should this go or what am i missing. I have googled etc im just new to access and having to learn on the job. Been thrown in at the deep end a bit

  6. #6
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Look at this link for the proper syntax. I believe that you may be missing some quotation marks from your expression.

    http://www.techonthenet.com/access/f...te/dateadd.php

  7. #7
    jhallcb is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2015
    Posts
    9
    Thanks for the help and input guys, cracked it.

    I was going about it in the wrong way trying to filter the report. I applied <=DateAdd("d",-45,Date())
    to the criteria in the query instead of the report and boom works a charm.

    Thanks again!

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

Similar Threads

  1. Overdue Account Query- Access 2010
    By lfarring in forum Queries
    Replies: 3
    Last Post: 06-04-2013, 03:31 PM
  2. Query for overdue maintenance
    By Rzadziu in forum Queries
    Replies: 4
    Last Post: 01-11-2013, 06:46 AM
  3. Setting an alert that a payment is overdue
    By bellevue in forum Database Design
    Replies: 6
    Last Post: 04-04-2012, 02:54 AM
  4. Replies: 5
    Last Post: 04-01-2012, 07:21 AM
  5. How to filter dates using an apply filter code.
    By Jgreenfield in forum Reports
    Replies: 4
    Last Post: 11-15-2011, 01:38 PM

Tags for this Thread

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