Re: displaying multiple dates in a table
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Thu, 7 Feb 2008 07:47:14 -0500
I agree with Allen Browne and John Vinson. The best thing you could do
would be to redesign your table structure. Allen's proposed structure would
let you handle households with any number of sons and daughters, plus if
needed grandparents and other significant individuals in the household.
If you cannot do that then you would need to build a fairly complex query
or better build a UNION query as the source for your birthday query and use
that as the source of your birthday query.
Sample Union query -
(UNION queries can only be built in the SQL view - you cannot use Design
View to build or display them.)
SELECT NameOf Primary as Person
, "Primary" as PersonType
, DOBOfPrimary as BirthDate
, HouseHoldAddress
FROM YourTable
UNION ALL
SELECT NameOf Spouse as Person
, "Spouse"
, DOBOfSPouse as BirthDate
, HouseHoldAddress
FROM YourTable
UNION ALL
SELECT NameOf Son as Person
, "Son"
, DOBOfSon as BirthDate
, HouseHoldAddress
FROM YourTable
UNION ALL
SELECT NameOf Daughter as Person
, "Daughter"
, DOBDaughter as BirthDate
, HouseHoldAddress
FROM YourTable
With that query saved, you can then use it to get persons with DOB in a
specific month.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"jonax" <jonax@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A1D7FD84-C00B-4067-BBC1-216606C1189E@xxxxxxxxxxxxxxxx
any help/advice is much appreciated.... let me explain...
i have this table w/c have multiple date/time fields... corresponding to
birthdays of people. a single record of a person contains his birthday,
his
spouse's name & birthday, and also his sons/daughters names & birthdays...
now i have already done a query in w/c i can get all persons birthday to
display per month (month parameter)...
i have done a query just like the one i made above, and it will display
the spouses & sons/daughters birthday corresponding to the month i typed
in.
but the query also displayed all the fields including the sons/daughter
birhtday whose not born in the month i typed!
what i need help is this; is there a way to make this query wherein i
type
a month ("mmm"), then the query will display ONLY the spouse's who have
birthdays on that month? w/o displaying the person's sons/daughters
birthdays
who was not born on the month i typed (& vise versa in case only the
person's
son was born in the month)?
many many thanx for your help in advance!!! ^_^
.
- Follow-Ups:
- Re: displaying multiple dates in a table
- From: jonax
- Re: displaying multiple dates in a table
- Prev by Date: Re: IIf function to calculate field
- Next by Date: Re: Date Difference In Query
- Previous by thread: Re: displaying multiple dates in a table
- Next by thread: Re: displaying multiple dates in a table
- Index(es):
Relevant Pages
|