Date Range Pulling Only Month

S

Sue

I am trying to create a query using a date range parameter [Birthdate] that
will pull just by month not by year and is ascending order. The criteria I
used was Between [Type Begin Date] and [Type End Date]. Any ideas???

Thanks, Sue
 
M

MGFoster

Sue said:
I am trying to create a query using a date range parameter [Birthdate] that
will pull just by month not by year and is ascending order. The criteria I
used was Between [Type Begin Date] and [Type End Date]. Any ideas???

Thanks, Sue

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don't you mean Begin Month and End Month instead of Begin Date and End
Date?

Perhaps this:

PARAMETERS [Enter Begin Month] Byte, [Enter End Month] Byte;
SELECT *
FROM table_name
WHERE Month(Birthdate) BETWEEN [Enter Begin Month] And [Enter End Month]

ORDER BY Month(Birthdate)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSRsSnIechKqOuFEgEQJjRQCg+cZzTaeMJZymbBIwvRDkOTr6wdYAoMqV
rN4dalxVf30crZeHj+AqnWcY
=rIkM
-----END PGP SIGNATURE-----
 
J

John W. Vinson

I am trying to create a query using a date range parameter [Birthdate] that
will pull just by month not by year and is ascending order. The criteria I
used was Between [Type Begin Date] and [Type End Date]. Any ideas???

Thanks, Sue

Just what do you mean by "pull by just month"?

If [Birthdate] in fact contains the date of the person's birth, and you want
to find this year's birthday anniversaries, put a calculated field in your
query:

HappyHappy: DateSerial(Year(Date()), Month([Birthdate]), Day([Birthdate]))

This will calculate the current calendar year's birthday anniversary date (use
with caution in December in other words). To find all upcoming birthdays, you
could apply your criteria to this calculated field, or use a criterion such as
= Date() AND < DateAdd("m", 1, Date())

to get all the birthdays for the next month from today (i.e. 11/13 - 12/13 if
run today).
 

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