473,545 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5207
No***********@h otmail.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",Da te)
2
? datePart("d",Da te)
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.B irthday
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 BirthDayThisYea r and then
use that for queries etc.
I use the DateSerial function to create that. --- DateSerial(year , month,
day)
so...
(Air code)
Function BirthDayThisYea r(myBDate As Date)
BirthDayThisYea r = DateSerial(Year (Date), Month(myBDate), Day(myBDate))
BirthDayThisYea r = CDate(BirthDayT hisYear) 'this may be redundant....
End Function

HTH
Mal.
"No***********@ hotmail.com" <ug********@hot mail.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.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
2134
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 (( DAYOFYEAR(gebdatum) < DAYOFYEAR(now()) )*366)+DAYOFYEAR(gebdatum) >= DAYOFYEAR(now())ORDER BY (( DAYOFYEAR(gebdatum) < DAYOFYEAR(now())...
51
989
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 to get moving and I need to know if what I have written so far is leading me in the right direction ~ Ok - The problem is to find out how many...
1
3386
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 birthdates. We would like to produce monthly reports providing us with a list of all members whose birthdate is coming up during any given month in...
2
5209
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 problem I now encounter is that the system takes the years into account. I already was thinking of exporting to outlook to get this done, but I think...
7
15470
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 DateDiff in VB.NET which is only available in C# if you don't mind linking in Microsoft.VisualBasic.dll to your C# application. I wanted to avoid this...
2
2471
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 (in which case, we will only send out "Happy birthday, Sam!"). I prefer using the builtin date type instead of three smallints. But I don't like...
2
2334
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 peoples 40th birthdays will fall on Saturday and Sunday, I may also be out of the office on certain days. So I need to "cast a net" to catch all...
13
3685
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 course of their lives, Sheila celebrates her birthday two days AFTER He-Man does. How is this possible? Bonus: What is the maximum amount of time...
1
2377
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 me the actual birthday, but not the day of the week. I feel like i am just missing one simple line of text but I can't figure out what it is. Any help...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.