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

Sorting dates without yeats to get a birthday list?

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
there must be a smarter way

Can anyone help me out of this problem.? Thanks in advance.
Edwin
Nov 13 '05 #1
2 5202
No Outlook required!!!

Very simple. Create a query.

SELECT Person.FName, Person.LName, Birthday AS
DateSerial(Year(Date),Month(Birthdate),Day(Birthda te))
FROM Person
ORDER BY Birthday;

check out DateSerial in the help. (I may be slightly off in my syntax,
but the basic idea is to calculate the date of the birthday in the
current year and sort by that.)

Nov 13 '05 #2
That would be

SELECT Person.FName, Person.LName,
DateSerial(Year(Date),Month(Birthdate),Day(Birthda te)) AS Birthday
FROM Person
ORDER BY DateSerial(Year(Date),Month(Birthdate),Day(Birthda te))

Unfortunately, you have to repeat the calculation: you can't just refer to
the field you created.

Another alternative would be:

SELECT Person.FName, Person.LName,
Format([Birthdate], "mmdd") AS Birthday
FROM Person
ORDER BY Format([Birthdate], "mmdd")

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<pi********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
No Outlook required!!!

Very simple. Create a query.

SELECT Person.FName, Person.LName, Birthday AS
DateSerial(Year(Date),Month(Birthdate),Day(Birthda te))
FROM Person
ORDER BY Birthday;

check out DateSerial in the help. (I may be slightly off in my syntax,
but the basic idea is to calculate the date of the birthday in the
current year and sort by that.)

Nov 13 '05 #3

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

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
22
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b)...
8
by: nidhog | last post by:
Hello guys, I made a script that extracts strings from a binary file. It works. My next problem is sorting those strings. Output is like: ---- snip ---- 200501221530
1
by: kgatchell2001 | last post by:
Hi, I am a beginner working on a database to manage clients, payroll, station assignments, etc. I have created a query which calculates age based on subtracting the date of birth from the current...
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
23
by: thebjorn | last post by:
For the purpose of finding someone's age I was looking for a way to find how the difference in years between two dates, so I could do something like: age = (date.today() - born).year but that...
2
by: MLH | last post by:
With a table of holidays and A97's date fn's - how best to count weekends and holidays between two dates? My holiday table has 4 fields. I will be adding records to it each year as info becomes...
2
by: rocket | last post by:
I need to make a query that will be run everyday that will send an email on a persons birthday. The query needs to compare the day and month of his/her birthday to the current date, and if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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,...
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...
0
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,...
0
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...

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.