Date Calculation in a query

A

Ant

I am trying to write a query that calculates what school year some one is in
from there date of birth. The information I have to work with is DOB &
obviously the current date. The criteria is that A School year is made up
of Children born between 1st September in one year and 31st August the next
year ( A year 3 pupil at the moment was born between 1st September 1998 and
31st August 1999). I guess I need a Datediff function but can not get my
head around how to put the into one year if bourn before 31st Aug and the
earlier year after that date.



Thanks for any help.
 
D

Darren

Select (Year(Date())-Year([birthdate])-IIf((Month([birthdate])>=9) And
(Day([birthdate])>=1),5,4)) as SchoolYear
From ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top