473,405 Members | 2,444 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,405 software developers and data experts.

sorting short dates, without using years

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 date. This
works fine and date of birth is entered as month, day, year in
standard short date format (99/99/0000;;).

Here is the problem, I would also like to print out a list of all
clients who have a birthday in any given month. Presently, when I
attempt to sort the list, it takes the whole date into account and
uses the year as well. Therefore, a person born in November of 1945
will be listed before a person born in January 1975. Is there a way to
sort by month and date only without entering a new variable for date
of birth? Can you ask Access to sort a short date without using the
year? Thank you in advance.

Kgatchell2001
Nov 13 '05 #1
1 2492
On 24 Jun 2004 13:56:24 -0700, kgatchell2001 wrote:
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 date. This
works fine and date of birth is entered as month, day, year in
standard short date format (99/99/0000;;).

Here is the problem, I would also like to print out a list of all
clients who have a birthday in any given month. Presently, when I
attempt to sort the list, it takes the whole date into account and
uses the year as well. Therefore, a person born in November of 1945
will be listed before a person born in January 1975. Is there a way to
sort by month and date only without entering a new variable for date
of birth? Can you ask Access to sort a short date without using the
year? Thank you in advance.

Kgatchell2001


In the query, add another column:
SortColumn:Format([DateOfBirth],"mm dd")
You can uncheck the Show check box as you don't need to display this
column.
Sort by this column.

Note... You haven't stated what expression you are using to calculate
age, but subtracting the date of birth from the current date may not
be accurate when computing the difference in years, i.e. someone born
on 12/31/2003 will be shown to be 1 year old on 1/1/2004.

Here is an expression you can use which is accurate.
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)

Hope this helps.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

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

Similar topics

7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
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)...
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...
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...
25
by: Dan Stromberg | last post by:
Hi folks. Python appears to have a good sort method, but when sorting array elements that are very large, and hence have very expensive compares, is there some sort of already-available sort...
3
by: CDMAPoster | last post by:
A.K.A. Is Double Dating a bad thing :-)? My post from several hours ago may have gotten lost so please forgive me if something similar to this shows up twice. From a modular programming class I...
10
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to...
0
by: daverskully | last post by:
I REALLY REALLY appreciate any help that anyone can offer. I have a table called Data with the following fields: 1) ID 2) ReportDate 3) Department 4) DepartmentNumber 5) AccountExecutive...
6
by: =?Utf-8?B?RGFu?= | last post by:
I am reposting a question from about 3 weeks ago ("sorting capability"). I have an aspx page in which I get the data from a database dynamically, through C# code, by creating a dynamic table...
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: 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
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
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
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
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...
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.