Results 1 to 7 of 7
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    Not Been Visited in over two years

    Hi I have the following fields in a query


    CustomerID , Service Call Date and Bill To

    I need to create a query that will only show the customers that have not had a service call date provided in over two years.

    Thank You
    Angie

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You may need this to get the last visit for each customer:

    http://www.baldyweb.com/LastValue.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Quote Originally Posted by pbaldy View Post
    You may need this to get the last visit for each customer:

    http://www.baldyweb.com/LastValue.htm
    Hi I have the following in my query

    datediff("d",[service call date], date ())
    Creteria = >360

    This works but I need it to just show the records that have not had any service date after the >360

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Angie,
    You said earlier
    have not had a service call date provided in over two years.
    If(datediff("d",[service call date], date ()))>= 730 then...

  6. #6
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    This didn't work for me

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If you are using in a query, perhaps you can use Orange's example in the criteria and not include it within an If, Then, Else.

    datediff("d",[service call date], date ()))>= 730

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

Similar Threads

  1. fiancial years
    By Compufreak in forum SQL Server
    Replies: 4
    Last Post: 05-10-2013, 12:12 AM
  2. in between dates pulling all years
    By mejia.j88 in forum Queries
    Replies: 2
    Last Post: 04-25-2012, 10:49 AM
  3. Compare data across years
    By lvh519 in forum Queries
    Replies: 4
    Last Post: 02-16-2012, 01:46 PM
  4. Replies: 0
    Last Post: 01-26-2011, 05:51 PM
  5. Select changes in the years
    By acs_one in forum Queries
    Replies: 8
    Last Post: 11-27-2010, 05:26 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