473,385 Members | 1,555 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,385 software developers and data experts.

How to retrieve comings birth days

kamill
71
Dear Strange Friends,

I need to fetch birth date (in dd-mm format) in ascending order start from current date(dd-mm format), But i am unable to write appropriate query. i have stored dateofbirth in date format(yyyy-mm-dd) in mysql DB.

i.e. if i have stored DOBs as 1999-07-11,2002-10-21,2004-06-15,2001-07-05,1994-08-17 and 2001-08-01 and current date is 2008-07-01 than my result must be looks like below

2008-07-05 (05-07)
1999-07-11 (11-07)
2001-08-01 (01-08)
1994-08-17 (17-08)
2002-10-21 (21-10)
2004-06-15 (15-06)

But i have much frustrated to how to achieve this. Please Help.

Thanks,
Kamil
Jul 1 '08 #1
2 1285
hsriat
1,654 Expert 1GB
Try to use DATE_FORMAT in the ORDER BY statement.
Jul 1 '08 #2
amitpatel66
2,367 Expert 2GB
ORDER BY Month - date in your query using DATE_FORMAT function as suggested in the above post
Jul 2 '08 #3

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

Similar topics

20
by: Gav | last post by:
I have a database with date of births stored dd/mm/yyyy (english dating system) and =date() returns a date in the same format in my server. how do i find the persons age using these two pieces of...
3
by: rbarkley | last post by:
I have imported a table from a source I cannot modify. There is a field for date of birth. It is text in the form "yyyymmdd". I need to query for all dob's in the month of May. It will not convert...
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...
11
by: tlyczko | last post by:
Hello, I'm new to SQL Server, working for a non-profit computerizing a lot of its data. I imported a table of people's names, birth dates, etc. into SS2005 from Access, and the birth_date was...
4
stormrider
by: stormrider | last post by:
Hi all, I'm trying to implement a Perl structure. My small program will do the followings; Take the birth date of the user as input. (Month's will be input as strings.) Take the current time...
4
by: Simon Gare | last post by:
Hi all, I am trying to retrieve a count of booking entries made 30 days ago, below is the end of the query I am having problems with. dbo.booking_form.TimeOfBooking = DATEADD(day, -30,...
2
by: Matuag | last post by:
Hi All, I am trying to create a form which can calculate with Age and Birth Date fields. I want Age to be calculated based on Birth Date (which I managed to do) but at the same time if Birth...
3
by: jamieharrop | last post by:
Afternoon all, I've been battling with this all day today and my brain is now pretty much fried. I have one table that lists several details about my customers (name, address, phone, date of...
1
by: jocelyn88 | last post by:
I would like to identify the Date of Birth, Gender and Age of a Malaysian by extraction the information from the new IC number. The object calculate the Date of Birth, Gender and Age. For example,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?

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.