Results 1 to 5 of 5
  1. #1
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91

    Date comparisons

    Hi, hope someone can help... I am trying to pull out when students were in their final year at school. At present I have all the dates when they hit 16 but I really need to know if they were 16 between 01/09 and 31/08 of that year, if not then they would fall in the previous year or the following year and then compare this with the date they took their qualifications and then allocate a code depending on if they took the qualification in their final year or before or if they have taken it since.



    I hope I have put this clear enough and if so any thoughts would be appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in the query:
    [Birthdate] between 01/09/yy and 31/08/yy

  3. #3
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Thank you, I've used this to establish their age and I have the date of their 16th birthday but I need to then compare this date against the award date and query out those that have taken the award during their final year.... if that makes sense.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You show dates as international, might review http://allenbrowne.com/ser-36.html

    Showing dates as U.S./Access structure - Maybe:
    SELECT StudentID, DateAdd("yyyy",16,[Birthdate]) AS BD16, Year([BD16])+IIf([BD16]>"8/31/" & Year([BD16]),1,0) AS FinalYr, Year([QualificationsDate]) AS QualYr, IIf(FinalYr=QualYr,"A","B") AS Code;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Thank you, I'll try that.... At present I have got round it with a union query looking at years separately but this means a lot of work each year to alter the queries.

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

Similar Threads

  1. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  2. Nested IIF for two comparisons
    By aflamin24 in forum Access
    Replies: 3
    Last Post: 09-19-2012, 05:18 PM
  3. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  4. Weekly reporting comparisons in query
    By Schon731 in forum Queries
    Replies: 3
    Last Post: 10-21-2010, 06:59 PM
  5. Grouping from several comparisons
    By piflechien73 in forum Queries
    Replies: 3
    Last Post: 05-26-2009, 04:15 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