Results 1 to 3 of 3
  1. #1
    ChrisNWV is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    7

    Date comparison return certain information.

    Good afternoon everyone.
    I have a date field (DueDate) that I am comparing against the current date (Date()). When the current date is greater than the DueDate I filter just those dates. I have done that without any problems. Now I am trying to figure out how to compare that filtered information to show that the DueDate is either over 30 days, over 60 days, or over 90 days overdo. If it shows up on either one of those lists I do NOT want it to show up on the other lists. I also want to have a counter by states. For example:

    Current Date DueDate State
    a. 9/22/14 2/1/14 GA *(90)
    b. 9/22/14 8/20/14 WV *(30)
    c. 9/22/14 7/1/14 WV *(60)
    d. 9/22/14 8/19/14 GA *(30)
    e. 9/22/14 7/31/14 GA *(30)
    f. 9/22/14 3/1/14 WV *(90)
    g. 9/22/14 7/20/14 SC *(60)

    The output I want should be:
    over 30 days:
    GA 2
    WV 1



    over 60 days:
    SC 1
    WV 1

    over 90 days:
    GA 1
    WV 1

    Thanks for any help.
    ChrisNWV

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Calc days with this in the query:
    select *, datediff("d",[DueDate],date()) as days

    then filter >60 or >90

  3. #3
    ChrisNWV is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    7
    Thanks so much!!!
    It did work.

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

Similar Threads

  1. Date Query help needed (comparison help)
    By quentinfox in forum Queries
    Replies: 4
    Last Post: 10-16-2013, 09:59 AM
  2. Date comparison syntax in query criteria
    By SyntaxSocialist in forum Queries
    Replies: 3
    Last Post: 04-09-2013, 08:39 AM
  3. RC Notation and Date Comparison
    By mkc80 in forum Access
    Replies: 2
    Last Post: 10-10-2012, 06:22 PM
  4. Date Comparison swapping month and day in VB
    By Mary Fall in forum Access
    Replies: 5
    Last Post: 04-21-2011, 06:31 AM
  5. Short date comparison
    By andy101 in forum Programming
    Replies: 2
    Last Post: 03-17-2011, 04:36 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