Help! I need to pull out all of the birthdays in a school term

  • Thread starter Thread starter Laphan
  • Start date Start date
L

Laphan

Hi All

I know this might not make much sense, but I'm hoping you can help!

I have a table consisting of the following:

StudentID StudentName DOB
1 Fred 12-04-1996
2 Brad 01-11-1996
3 Gary 23-12-1996
4 Jill 16-01-1997

I need to do a query so that I get all of the students that have a birth
date that falls between 1 Sept - 31 Dec, 1 Jan - 31 Mar and 1 Apr - 31 Jul.

I tried to do a select StudentName, DOB from Students where day(DOB) & '-' &
month(DOB) > #01-09# and day(DOB) & '-' & month(DOB) < #31-12# order by 2,
but because I've not put a year it's getting everything between 1-9-the
first year to 31-12-the last year.

I need to get everybody between the specified sets irrespective what year
they come in.

Any ideas?

Thanks

Laphan
 
well, you're not doing any partial months, so i'd forget days altogether.
you can add a calculated field to the query, as

BDMonth: Month(DOB)

set criteria on the calculated field, as

<4

for Jan - Mar,

Between 4 and 7

for Apr - Jul, and

Between 9 and 12

for Sep - Dec.

hth
 
tina you're a gem!!!

My brain ain't working at the optimum speed at the mo!!

Thanks again

well, you're not doing any partial months, so i'd forget days altogether.
you can add a calculated field to the query, as

BDMonth: Month(DOB)

set criteria on the calculated field, as

<4

for Jan - Mar,

Between 4 and 7

for Apr - Jul, and

Between 9 and 12

for Sep - Dec.

hth
 
you're welcome :)


Laphan said:
tina you're a gem!!!

My brain ain't working at the optimum speed at the mo!!

Thanks again

well, you're not doing any partial months, so i'd forget days altogether.
you can add a calculated field to the query, as

BDMonth: Month(DOB)

set criteria on the calculated field, as

<4

for Jan - Mar,

Between 4 and 7

for Apr - Jul, and

Between 9 and 12

for Sep - Dec.

hth


'-'
 
Back
Top