Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Anniversary Report in the Genealogy Db
Bj Schroeder 
     
2 months ago
Hi Everyone, I am working with Richard's Genealogy DB. Thank you Richard! I added an "AnniversaryR" report to see who's married to whom. I am not getting all the records that I know should be there ie: I'm only getting first marriages and not second or other marriages.
Bj Schroeder OP  @Reply  
     
2 months ago
I unsuccessfully tried to upload some screen shot
Alex Hedley  @Reply  
           
2 months ago
What's your Query?
Tom Juric  @Reply  
     
2 months ago
I have a report that shows each person and their life event but i only need: Birth, Death, Wedding.  You can tweak it to show the other event types.
Tom Juric  @Reply  
     
2 months ago

Tom Juric  @Reply  
     
2 months ago
SQL Code for query:

INSERT INTO tblLifeEventsPerson2 ( PersonT_FirstName, PersonT_LastName, LifeEventTypeID, Event, LifeEventDate, PersonT_1_FirstName, PersonT_1_LastName )
SELECT PersonT.FirstName, PersonT.LastName, LifeEventT.LifeEventTypeID, IIf([LifeEventT]![LifeEventTypeID]=1,"Birth",IIf([LifeEventT]![LifeEventTypeID]=2,"Death",IIf([LifeEventT]![LifeEventTypeID]=3,"Wed",IIf([LifeEventT]![LifeEventTypeID]=8,"Divorce","none")))) AS Event, LifeEventT.LifeEventDate, PersonT_1.FirstName, PersonT_1.LastName
FROM (LifeEventT LEFT JOIN PersonT ON LifeEventT.PersonID = PersonT.PersonID) LEFT JOIN PersonT AS PersonT_1 ON LifeEventT.Person2ID = PersonT_1.PersonID;
Bj Schroeder OP  @Reply  
     
2 months ago
Alex Hey Alex I tried to upload some screen shots of the query and report but was unable. will try again.
Bj Schroeder OP  @Reply  
     
2 months ago

Bj Schroeder OP  @Reply  
     
2 months ago

Bj Schroeder OP  @Reply  
     
2 months ago

Bj Schroeder OP  @Reply  
     
2 months ago

Tom Juric  @Reply  
     
2 months ago
Did you try pasting my SQL into the SQL view of query?
Raymond Spornhauer  @Reply  
          
42 days ago
Bj

Do not use an "Insert Into...." Query... that will add more records.

You need to determine if the problem is in the Query or the Report.  If you run the query by itself, does it show all the records you expect?

-Raymond
Richard Rost  @Reply  
          
42 days ago
Bj, if you're still having trouble after trying the suggestions here, feel free to post the SQL for your current query as text (not a screenshot) so we can take a closer look and offer more specific guidance.
Bj Schroeder OP  @Reply  
     
42 days ago
Richard SELECT SpecialDateQ.*, DateDiff("yyyy",[AnniversaryDate],Date())+(DateSerial(Year(Date()),Month([AnniversaryDate]),Day([AnniversaryDate]))>Date()) AS YearsMarried, Format([AnniversaryDate],"mmm") AS DateFormat, Year([AnniversaryDate]) AS Y, Month([AnniversaryDate]) AS M, Day([AnniversaryDate]) AS D, DLookUp("Person2ID","LifeEventT","PersonID=" & [PersonID] & " AND " & "LifeEventTypeID=3") AS Spouse
FROM SpecialDateQ
Richard Rost  @Reply  
          
42 days ago
Bj, I'm pretty sure the issue is that you're using DLookUp to pull the spouse. DLookUp can only ever return a single value, so if someone has multiple marriage records, it will just grab the first match it finds and ignore the rest. That's why you're only seeing first marriages.

Instead of looking up the spouse with DLookUp, the report should be based directly on the marriage records themselves so you get one row per marriage. That way second and third marriages will naturally show up.

Before changing the report, try running the underlying query by itself and make sure it's returning all the marriage records you expect. If the query only shows one per person, that's where the fix needs to happen.
Bj Schroeder OP  @Reply  
     
41 days ago
Richard Thanks Richard
Bj Schroeder OP  @Reply  
     
40 days ago
Thanks to all for your quick responses. Richard, it was a DLookUp in the query.
I changed the query to:
SELECT PersonT.PersonID, PersonT.FirstName, PersonT.MiddleName, PersonT.LastName, PersonT.NickName, PersonT.OtherLastName, PersonT.Gender, PersonT.SuffixID, LifeEventT.LifeEventDate AS AnniversaryDate, DateDiff("yyyy",[AnniversaryDate],Date())+(DateSerial(Year(Date()),Month([AnniversaryDate]),Day([AnniversaryDate]))>Date()) AS YearsMarried, Format([AnniversaryDate],"mmm") AS DateFormat, LifeEventT.Notes, Year([AnniversaryDate]) AS Y, Month([AnniversaryDate]) AS M, Day([AnniversaryDate]) AS D, [LastName] & ", " & [FirstName] & " " & [SuffixAbb] AS LF, SuffixT.SuffixAbb
FROM (PersonT INNER JOIN LifeEventT ON PersonT.PersonID = LifeEventT.PersonID) LEFT JOIN SuffixT ON PersonT.SuffixID = SuffixT.SuffixID
WHERE (((LifeEventT.LifeEventDate) Is Not Null) AND ((LifeEventT.LifeEventTypeID)=3))
ORDER BY PersonT.LastName, PersonT.FirstName;
Bj Schroeder OP  @Reply  
     
40 days ago
I am working on incorporating DOD or Divorce dates to get an accurate [YearsMarried].

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/13/2026 7:15:48 AM. PLT: 1s