Results 1 to 4 of 4
  1. #1
    tmanDuer is offline Novice
    Windows 10 Access 2002
    Join Date
    Sep 2017
    Posts
    9

    Quering LAST 3 FULL YEARS

    Hello all, I have a table called 'TblApplications' where I would like to bring records back from the previous full 3 years only. So, this being 2017, I would like to run a query and bring back only (and all) records from 2016, 2015, 2014. My field name is 'applydate' with of course other fields related to when someone applies(name, DOB, etc)



    I have
    Select...... Where (((applydate) Between DateAdd("yyyy",-3,[Forms]![frm_Apply]![Start Date]) And [Forms]![frm_Apply]![End Date]....

    As you can see this bring back the last 3 years of data Between the 'Start Date' and 'End Date' The start and end date are something that the user has already added in from the frm_apply form. I was hoping to use the date already in place so the user would have to do anything else except click the 3 year report button.

    As I am typing this I realize I may not have done a great job at explaining, but I think you might get the jest... In current year, how to you query for just the last 3 full years of data.

    Thank you so much, I appreciate any help!

    TmanDuer

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try this:
    Code:
    Between DateSerial(Year(Date())-4,1,1) And DateSerial(Year(Date())-1,12,31)

  3. #3
    tmanDuer is offline Novice
    Windows 10 Access 2002
    Join Date
    Sep 2017
    Posts
    9
    I tip my hat to you, JoeM! This works perfectly. THANK YOU!

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

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

Similar Threads

  1. Not Been Visited in over two years
    By angie in forum Queries
    Replies: 6
    Last Post: 05-04-2015, 10:23 AM
  2. Quering Three tables causes duplicates
    By BatmanMR287 in forum Access
    Replies: 10
    Last Post: 01-07-2015, 07:15 PM
  3. fiancial years
    By Compufreak in forum SQL Server
    Replies: 4
    Last Post: 05-10-2013, 12:12 AM
  4. Select changes in the years
    By acs_one in forum Queries
    Replies: 8
    Last Post: 11-27-2010, 05:26 PM
  5. Quering to find a status
    By dbuck in forum Queries
    Replies: 5
    Last Post: 09-08-2010, 02:48 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