PC Review


Reply
Thread Tools Rate Thread

Return Birthdates regardless of year

 
 
Torie
Guest
Posts: n/a
 
      5th Nov 2003
Hi,

I have birthdates that are stored in a Date/Time field in
the following format "1967-12-29".

I want to be able to create a query where I can return all
the birthdates that took place between Dec 12th to Dec
30th in the database. I do not care about the year, just
the date range.

How would I go about creating such a query?
 
Reply With Quote
 
 
 
 
Brian Camire
Guest
Posts: n/a
 
      5th Nov 2003
For this specific problem, you might try a query whose SQL looks something
like this:

SELECT
[Your Table].*
FROM
[Your Table]
WHERE
Month([Your Table].[Birthdate]) = 12
AND
(Day([Your Table].[Birthdate]) Between 12 And 30)

For a more the more general problem where the start and end dates may be in
different months and may be affected by leap years, you might use a slightly
different approach.

"Torie" <(E-Mail Removed)> wrote in message
news:0e1001c3a3a0$b6c0a840$(E-Mail Removed)...
> Hi,
>
> I have birthdates that are stored in a Date/Time field in
> the following format "1967-12-29".
>
> I want to be able to create a query where I can return all
> the birthdates that took place between Dec 12th to Dec
> 30th in the database. I do not care about the year, just
> the date range.
>
> How would I go about creating such a query?



 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      5th Nov 2003
Torie

Brian's already provided a solution specific to your post. I'll just point
out that an Access Date/Time field stores a number ... how you format it to
display (e.g., "1967-12-29") is totally irrelevant when it comes to
querying.

Good luck

Jeff Boyce
<Access MVP>

 
Reply With Quote
 
Torie
Guest
Posts: n/a
 
      5th Nov 2003
Many thanks! Your suggestion has actually helped me out a
lot and I already have an idea on how I will customize it
further. Thank-you.


>-----Original Message-----
>For this specific problem, you might try a query whose

SQL looks something
>like this:
>
>SELECT
>[Your Table].*
>FROM
>[Your Table]
>WHERE
>Month([Your Table].[Birthdate]) = 12
>AND
>(Day([Your Table].[Birthdate]) Between 12 And 30)
>
>For a more the more general problem where the start and

end dates may be in
>different months and may be affected by leap years, you

might use a slightly
>different approach.
>
>"Torie" <(E-Mail Removed)> wrote in

message
>news:0e1001c3a3a0$b6c0a840$(E-Mail Removed)...
>> Hi,
>>
>> I have birthdates that are stored in a Date/Time field

in
>> the following format "1967-12-29".
>>
>> I want to be able to create a query where I can return

all
>> the birthdates that took place between Dec 12th to Dec
>> 30th in the database. I do not care about the year, just
>> the date range.
>>
>> How would I go about creating such a query?

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort business contacts by birthday month, regardless of year Brad Bennett Microsoft Outlook BCM 0 3rd Nov 2009 06:20 PM
query birthdates occuring in year range Mary Microsoft Access Queries 2 3rd Sep 2008 08:22 PM
I want to sort by month, date, year. Birthdates. How do I do it =?Utf-8?B?U2hlYmFtYW5keQ==?= Microsoft Excel Worksheet Functions 2 17th Oct 2006 04:52 PM
list two year old birthdates =?Utf-8?B?YW5uZQ==?= Microsoft Access 12 18th Apr 2006 03:36 AM
How do I sort a column of 5+ birthdates by year in a report? =?Utf-8?B?Q2h1cmNoU2VjcmV0YXJ5?= Microsoft Access Reports 2 24th Sep 2004 01:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:48 PM.