Results 1 to 2 of 2
  1. #1
    Aaron Greatbanks is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    1

    Formula to find dates before a certain date based on certain conditions

    Hello



    I have a ICT exam on databases in January for A2 ICT. It is based on a sixth form college

    In the scenario which we are given, they have informed us that we will need to "Automatically flag up students who have completed the first year"

    I'm searching for a formula that will look for start dates of students before the 1st September but the year of the 1st September changes

    I so far have used the following formula:

    <DateSerial(Year(Date())-0,9,1)

    This will look for students that enrolled before 01/09/2012 if i used it based on today. However, when 2013 comes, this formula will find people that enroled before 01/09/2013 which isn't what we'd be looking for

    We would need this formula

    <DateSerial(Year(Date())-1,9,1)

    However, i need to find a formula that automatically updates so that it finds people who enroled before the last 1st September

    So if say i was running this query of 9th March 2013, i'd be looking for people who enrolled before 01/09/2012.

    Can you think of any solutions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This give you any ideas?

    Year(Date()) - IIf(Month(Date()) < 9, 1, 0)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Select Random Records Based on Conditions
    By access123 in forum Queries
    Replies: 1
    Last Post: 10-27-2010, 10:25 AM
  2. Replies: 13
    Last Post: 09-27-2010, 03:10 PM
  3. Replies: 3
    Last Post: 09-29-2009, 07:08 AM
  4. Replies: 0
    Last Post: 07-27-2009, 07:51 AM
  5. Total based on Formula based on field value
    By cjbuechler in forum Reports
    Replies: 15
    Last Post: 07-10-2009, 09:56 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