473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Birthday in a query?

Hi, i did a search and find the way to get the birthday without the
year.

My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31)
and a month field. (1 to 12)

My problem is: I can get the birthday for one month in particular, but
i would like to be able to get birthday for a week that goes over 2
month.

ie: The last week of february 2006.
Sunday is february 26th and Saturday is march fourth. So far nothing
seems to work.

I would like to have something like this : Between [first date: mm/dd]
and [second date: mm/dd].

I cant put this in my birthday field because of the year (i think), i
did try a [Month]/[Day] field but it doesnt work.

any idea???

thx.

Feb 17 '06 #1
5 5190
No***********@hotmail.com wrote:
Hi, i did a search and find the way to get the birthday without the
year.

My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31)
and a month field. (1 to 12)

My problem is: I can get the birthday for one month in particular, but
i would like to be able to get birthday for a week that goes over 2
month.

ie: The last week of february 2006.
Sunday is february 26th and Saturday is march fourth. So far nothing
seems to work.

I would like to have something like this : Between [first date: mm/dd]
and [second date: mm/dd].

I cant put this in my birthday field because of the year (i think), i
did try a [Month]/[Day] field but it doesnt work.

any idea???

thx.

? datePart("yyyy",Date)
2006
? datePart("m",Date)
2
? datePart("d",Date)
17
? Month(date)
2
? Day(Date)
17
In your case of going over 2 months, in your example, you'd best compare
for each month.
Where (Month(Birthday) = 2 And Day(BirthDay) >= 26) Or
(Month(Birthday) = 3 And Day(BirthDay) <= 4)
Feb 17 '06 #2
thx i'll give it a shot.

Feb 17 '06 #3
SELECT BirthdayTable.Birthday
FROM BirthdayTable
WHERE ((BirthdayTable.Birthday) Between #2/26/2006# And #3/4/2006#);

Feb 17 '06 #4
that wont work, cuz nobody is born in that particular week in 2006 that
work for us. U have to remove the year.

Don't have a working solution sor far but i'll keep thinking about it.

Feb 20 '06 #5
Mal
In a couple of different circumstances I calculate BirthDayThisYear and then
use that for queries etc.
I use the DateSerial function to create that. --- DateSerial(year, month,
day)
so...
(Air code)
Function BirthDayThisYear(myBDate As Date)
BirthDayThisYear = DateSerial(Year(Date), Month(myBDate), Day(myBDate))
BirthDayThisYear = CDate(BirthDayThisYear) 'this may be redundant....
End Function

HTH
Mal.
"No***********@hotmail.com" <ug********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
that wont work, cuz nobody is born in that particular week in 2006 that
work for us. U have to remove the year.

Don't have a working solution sor far but i'll keep thinking about it.

Feb 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter Ruijter | last post by:
Hello, I've read and used the birthday solutions of Wolfgang Führer from the mySQL DATE examples on the mysql.com website. SELECT naam, gebdatum FROM users WHERE gebdatum != '0000-00-00' AND...
51
by: Sandra | last post by:
I was given this problem for extra credit and I am just stuck ! BTW - I am not asking for source code and I am not asking anyone to do my homework as I do want to learn .. I just need a hint or two...
1
by: Claude Alain | last post by:
Hello! We are a small non-profit organisation with about 400 members. We have created a database using Access97 which contains tombstone information on our members, including home adresses and...
2
by: edwin van rutten | last post by:
Hi I have a personal database of all adresses etceteras of personal contacts and want to sort the birthday dates in such a way that I have a chronological list for this years birthdays. The...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
2
by: David Garamond | last post by:
What would be the more proper way of storing birthday data? It will be used to send out birthday messages for customers ("Happy 30th birthday, Sam!"). But the date of birth is not necessarily known...
2
by: Paul H | last post by:
I have a db that stores people and their birth dates. On any given day, I need to know who has a 40th birthday one month from now. I will only be running the query on week days but of course some...
13
kestrel
by: kestrel | last post by:
Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately after each other, an infinitesimally small - but nonzero - amount of time apart. During one year in the...
1
by: stilldancin12 | last post by:
Ok so i have to write an application that asks for the users birthday and replies with they day of the week in which he or she is born on, using the java program. This is what I have so far.It gives...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.