473,800 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

upcoming birthdays query

13 New Member
Hi

I have a database birthday containing name and DOB,
I want to find the query which can display 3 latest birth day.

I tried
select name,date from birthday where month(dob)>=mon th(curdate()) limit 3;

But the problem here is that on 31-December-2008 it will not display the birthdays on January.

Shashank
Oct 30 '08 #1
6 7595
r035198x
13,262 MVP
Why are you taking the month parts?
Try something like
Expand|Select|Wrap|Line Numbers
  1. where dob >= curdate() order by dob limit 3;
Oct 30 '08 #2
onlyshanks28
13 New Member
Why are you taking the month parts?
Try something like
Expand|Select|Wrap|Line Numbers
  1. where dob >= curdate() order by dob limit 3;
Problem with it is:

If Current date is 31 december 08

then it will not display birthday in the moth if january 09

Also dob can never be more than currdate( )

MY dob is 28-08-1986(suppose) it cant be greater than currdate( )
Oct 30 '08 #3
onlyshanks28
13 New Member
for it we have to use three query subsequently

1) select name,date from days_to_remembe r where month(date)=mon th(curdate()) AND date(date)>=dat e(curdate()) order by date asc;

-----it will give upcomng bdays of same months---



2) select name,date from days_to_remembe r where month(date)>mon th(curdate()) order by date asc;

-----it will give upcomng bdays of next months---

3) select name,date from days_to_remembe r order by date asc;

-----it will give upcomng bdays of next year---


use a counter element to limit the number of elements
Oct 30 '08 #4
r035198x
13,262 MVP
Problem with it is:

If Current date is 31 december 08

then it will not display birthday in the moth if january 09

Also dob can never be more than currdate( )

MY dob is 28-08-1986(suppose) it cant be greater than currdate( )
Oh silly me. I get your point now. The year part should not be included in the comparison.
Oct 30 '08 #5
onlyshanks28
13 New Member
Oh silly me. I get your point now. The year part should not be included in the comparison.
thats correct
but
we do have to take into cosideration the year when the current date is
31-dec-2008..

the above 3 queries that i have given will do that perfectly
Oct 31 '08 #6
RahulGuptaRG
1 New Member
great
Thanks a lot.
Aug 4 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2452
by: Stijn Goris | last post by:
hi all, I have this problem that I cant solve. I have created an agenda (http://28edegem.scoutnet.be/agenda.php) . The agenda contains events and birthdays of the members. I query the events and birthdays per month and sort them on date. This method works fine for the events since they are all for the same year (eg 2003) but doesnt work for the birthdays because someone born in 1980-06-23 will be sorted before someone born in...
0
1222
by: Joel Burton | last post by:
The newly-formed Zope/Python Users Group of DC announces our upcoming meeting schedule: Mo Jul 19: Zope -- presentation on Archetypes by Joel Burton Th Aug 5: Python -- no topic yet Mo Aug 16: Zope -- no topic yet Th Sep 2: Python -- no topic yet
1
2435
by: JR | last post by:
Hi -- I would like to know if it is possible to program Access to notify a user of an upcoming date. For example, in a database of people, if one has a final report in 30 days, can Access be programmed to let the person managing all these people know that that report will be due? If it can do this, in what form would the notification show up -- email, pop-up, etc? Also, can Access be programmed to take certain information from a file
0
2224
by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices Group. For the full list of upcoming Windows Mobile and Embedded chats, to review archived chat sessions, or to request a reminder for a chat, visit http://msdn.microsoft.com/embedded/community/community/chats/. Also, the Windows Mobile and...
0
1143
by: Nick White [MSFT] | last post by:
Hello fellow Windows Mobile and Embedded enthusiasts: Allow me to direct your attention to the list below of upcoming Windows Mobile and Embedded product chats and Webcasts. I invite you to attend any and all that may pique your interest. CHATS PLATFORM BUILDER DOCUMENTATION: LIVE CHAT WITH WRITERS March 31, 2005, 10:00-11:00 A.M. Pacific Time
26
2462
by: Yeah | last post by:
I have a web site which changes the header logo based on the upcoming holiday. For example, from December 10th to 25th, XMAS.JPG is displayed. From October 20th to 31st, HALLWEEN.JPG is displayed. Etc. etc. If today's date is not near a holiday, then the default LOGO.JPG is displayed. A while back, I was looking for a JavaScript that does this automagically. But each snippet I found traditionally displays the default logo for a...
1
2189
by: relisoft | last post by:
SEATTLE, Washington. - July 12, 2006: Reliable Software® announces the upcoming release of Code Co-op® version 5.0. Code Co-op is an affordable peer-to-peer version control system for distributed development enabling collaboration through Email, LAN, or VPN-no server required. The upcoming release of Code Co-op 5.0 is due out this fall. With this release Reliable Software continues its track record of innovation by introducing...
3
1599
by: Bo Wisén | last post by:
In a MYSQL database I have stored when the members were born in the form "YYYYMMDD". Now I want a method to select every member who has birthday from today and up to 30 days into the future. I would prefer if this could be done in a MYSQL query. Can anyone tell me how to do this? I have figured out some solutions that will work, but unfortunately not in December because the year will turn. / Bo
6
2238
by: schlow09 | last post by:
I have been trying to automate certain steps in this database for a company I am working with. I would like to have a query or report run automatically at startup showing all the records that have a due date (the date when people are supposed to pay) of a week from the current date so I can see which orders have a payment due date that is near to come. This date is a field in the orders table. I don´t know if anyone could help me with this, I...
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10276
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.