473,763 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing dates of birth to find twins

Hi,

I have a database with insurance clients and their dependents (spouses
and children). We had a problem in the past with the twins and some of
them have been entered with one month difference in their dates of
birth, some of them have the same dates of births. I need to query
both cases. In the case where they are set up with one month
difference, the dates of birth has to be within 4 months of each other
and excluding the ones that are identical).

Here's my table fields:

POLICY
CLIENT #
MEMBER_LAST
MEMBER_FIRST
DEP_ NAME
DEP_DOB

POLICY CLIENT# MEMBER_LAST MEMBER_FIRST DEP_NAME DEP_DOB
111111 12345 BROWN SOPHIE LILI 2000/02/01
111111 12345 BROWN SOPHIE ROSA 2000/03/01
111111 12345 BROWN SOPHIE GERRY 2000/04/01
222222 54321 BOUCHARD BEN ANTOINE
1999/05/25
222222 54321 BOUCHARD BEN JULIE 1996/01/21
333333 44555 BAUER JACK KIM 1993/08/05
333333 44555 BAUER JACK ANDREA 1993/08/05

We have both cases here: twins set up with a difference of a month
(client # 12345) and twins with same date of bith (client # 44555). We
also have another example where the dependents are regular brothers and
sisters.

Does anyone know how to do this?

Thanks!

May 10 '06 #1
4 2647
Working_Girl wrote:
POLICY
CLIENT #
MEMBER_LAST
MEMBER_FIRST
DEP_ NAME
DEP_DOB


I'm assuming this is one table? If so, this is an incredibly awful
structure and is more like a spreadsheet than anything. If you want to
use spreadsheets, then use Excel. If you want to use relational
databases, then you need to normalize your structure.

You need to do this before you start trying to apply SQL to your current
structure and begin learning very, very bad lessons.

How you structure your data depends on questions for which I don't know
the answers.

Can more than one member own a policy?

Can members own more multiple policies?

Can dependents be listed on multiple policies?

Can multiple dependents be listed on one policy? (from your original
post, the answer is yes)

My approach would be to have one policy table on which policy number,
policy details are listed. THIS WAY, POLICY DETAILS ARE LISTED ONCE AND
ONLY ONCE.

I would have a single "people" table with people, dependents and owners
listed. Birthday and other information could be listed (I would have a
separate table for addresses as well, BTW). Each person record would
need an identifier which we can call the client number (whether or not
the person is a dependent) as each person could be listed multiple times
as owners of policies, dependents in a policy and so on. THIS WAY, A
PERSON IS LISTED ONCE AND ONLY ONCE.

Finally, a look up table which will have multiple records per policy
with just the policy identifier listed as a field to indicate which
policy. There would also be a field which indicated "dependent" or
"owner" (you could use a code for this and have this field specified to
accept only "d" or "o" or whatever stuff you wish to have in there.
Alternately, yet another table could be devised which lists people
types, but that starts getting complicated for you, I think - this is
involved enough). Next, a person identifier field which holds only the
identifier of the person from the People table is required.

RElationships should be devised with referential integrity enforced
between the linking fields.

Thus, you'll have a single policy, 111111, listed in the policy table.

BROWN SOPHIE will be listed in the people table with a client number of
12345.

Lila, Rosa and gerry Brown will be also listed in the people table with
client numbers of 12346, 12347, 12348, for example.

In the look up table, Sophie's record for this policy will be listed as:

Policy_Identifi er: 111111
People/Client_Identifi er: 12345
People Type: o

The kids will be listed like this:

Policy_Identifi er: 111111
People/Client_Identifi er: 12346
People Type: d

Policy_Identifi er: 111111
People/Client_Identifi er: 12347
People Type: d

Policy_Identifi er: 111111
People/Client_Identifi er: 12348
People Type: d

From this sort of arrangement, you devise queries for dependents,
bringing out birthdates.

If this sounds too complex, and more than you want to do, then Access is
the wrong tool for you.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
May 10 '06 #2
This is a large dump of information that I am getting from mainframe,
that's how I'm gonna get hundreads of thousands of records (can't work
with that in excel), I know it's no good structure but this is what I
have to work with...

May 11 '06 #3
Is there anything stopping you from importing the raw data to a
temporary table and then parsing the data so that it's normalized?
Then you can query the data with normal SQL without making yourself
nuts.

May 15 '06 #4
Things for thought.

Not sure why you are using four months as a criteria. It is possible for
twins to be born in different years, but the difference in dobs should be
one day or less.

It is possible to have dependants with different mothers, so they could have
the same dob, but not be twins.

John... Visio MVP

"Working_Gi rl" <so************ *@hec.ca> wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
Hi,

I have a database with insurance clients and their dependents (spouses
and children). We had a problem in the past with the twins and some of
them have been entered with one month difference in their dates of
birth, some of them have the same dates of births. I need to query
both cases. In the case where they are set up with one month
difference, the dates of birth has to be within 4 months of each other
and excluding the ones that are identical).

Here's my table fields:

POLICY
CLIENT #
MEMBER_LAST
MEMBER_FIRST
DEP_ NAME
DEP_DOB

POLICY CLIENT# MEMBER_LAST MEMBER_FIRST DEP_NAME DEP_DOB
111111 12345 BROWN SOPHIE LILI 2000/02/01
111111 12345 BROWN SOPHIE ROSA 2000/03/01
111111 12345 BROWN SOPHIE GERRY 2000/04/01
222222 54321 BOUCHARD BEN ANTOINE
1999/05/25
222222 54321 BOUCHARD BEN JULIE 1996/01/21
333333 44555 BAUER JACK KIM 1993/08/05
333333 44555 BAUER JACK ANDREA 1993/08/05

We have both cases here: twins set up with a difference of a month
(client # 12345) and twins with same date of bith (client # 44555). We
also have another example where the dependents are regular brothers and
sisters.

Does anyone know how to do this?

Thanks!

May 15 '06 #5

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

Similar topics

9
2774
by: Thomas W | last post by:
I'm developing a web-application where the user sometimes has to enter dates in plain text, allthough a format may be provided to give clues. On the server side this piece of text has to be parsed into a datetime python-object. Does anybody have any pointers on this? Besides the actual parsing, my main concern is the different locale date formats and how to be able to parse those strange us-like "month/day/year" compared to the clever...
4
2478
by: J P Singh | last post by:
Hi All I am trying to query a database with a combination of surname and date of birth but it is giving me wrong results in certain conditions. It is the mm/dd/yyyy and dd/mm/yyyy stuff that is not making it work. If I enter date like 25/12/1976 then it works fine as the date will not be valid like 12/25/1976 and everything works fine and my query executes properly.
4
2412
by: F | last post by:
Hi I have posted the question few days back about problem in inserting the dates in SQL server and thankful to them who replied. That was solved and this is a nice solution. http://www.aspfaq.com/show.asp?id=2023 Now I am facing another problem. I have to get data between two dates. That dates user has to provide and in
4
5390
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
26
4413
by: Frank | last post by:
For my website i would like to display the age of my son in years, months, days and hours. For now i manage to get a result for totals. Like the total number of days. This is the beginning: starttime = Date.parse("Aug 10,2003, 07:07") sdt = new Date(starttime)
52
4595
by: Andy Dingley | last post by:
I'm using this at present: <p title="Publication date" ></p> Works fine on screen, but Fangs/Jaws just reads it as "left bracket twenty-eight slash zero slash two thousand five fifteen colon zero right bracket" Really it needs something more to indicate that it _is_ a date. The brackets would be better done with CSS, :before and content: , but the boss wants it to work under IE too. The site is firmly UK
1
2514
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 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,...
2
1838
by: Duppypog | last post by:
I'm trying to compare a date stored in a database with today's date using an If statement, but it's not returning true. Example, value in database is 11/5/2003 with today being 11/6/2003. Can someone spot the problem? Thanks, Lynnette Here's the code: sSQL = "Select PWExpire FROM tblUsers where strUserName = '" & stUser & "' AND strPassword = '" & hshPW & "'"
5
7311
by: romanisa | last post by:
Hii friends I need to calculate the age median from the given dates of birth in an employee database in MS SQl. Please help... Roma
0
9383
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
10140
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9992
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
9935
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
9819
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...
0
8821
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7364
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...
0
5268
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3519
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.