Results 1 to 2 of 2
  1. #1
    BrianLundell is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4

    Post How to put birthdays, anniversaries, divorced and deceased date report

    I have a contacts management database where I have added four date fields to the main table labled: Birthday, Anniversary, Divorced, and Deceased. I would like to print out a report that only has three headers: Name, Event (includes whichever of the above four choices, as appropriate), and Date.

    Desired format: (Sorted by month and day, but not by year)



    Name Event Date
    George Birthday 1/14/2002
    Nancy Anniversary 2/3/1998
    Tim Deceased 3/5/2013
    Bob Divorced 5/31/2006

    Suggestions?

  2. #2
    BrianLundell is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    4
    Solution found. Thanks for reading. It was a fairly simple UNION query, and someone created it for me. I'll post it here in case anyone needs to see the answer in the future.

    <code>
    SELECT Contacts.ContactName, "Birthday" AS Event, Format([Birthday],"mmdd") AS EventSort, Format([Birthday],"mm/dd/yyyy") AS EventDate
    FROM Contacts
    WHERE Contacts.Deceased is null and Contacts.Birthday is not null
    UNION
    SELECT Contacts.ContactName, "Anniversary" AS Event, Format([Anniversary],"mmdd") AS EventSort, Format([Anniversary],"mm/dd/yyyy") AS EventDate
    FROM Contacts
    WHERE Contacts.Deceased Is Null and Contacts.Divorced is null and Contacts.Anniversary is not null
    UNION
    SELECT Contacts.ContactName, "Divorced" AS Event, Format([Divorced],"mmdd") AS EventSort,Format([Divorced],"mm/dd/yyyy") AS EventDate
    FROM Contacts
    WHERE Contacts.Deceased Is Null and Contacts.Divorced is not null
    UNION
    SELECT Contacts.ContactName, "Deceased" AS Event, Format([Deceased],"mmdd") AS EventSort,Format([Deceased],"mm/dd/yyyy") AS EventDate
    FROM Contacts
    WHERE Contacts.Deceased Is not Null
    ORDER BY EventSort;
    </code>


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-23-2013, 10:43 PM
  2. Birthdays
    By comfygringo in forum Queries
    Replies: 3
    Last Post: 07-11-2013, 07:29 PM
  3. Birthdays
    By bambi_ in forum Queries
    Replies: 1
    Last Post: 05-22-2012, 03:29 AM
  4. Date Range Report with Multiple Date Fields
    By StevenCV in forum Reports
    Replies: 13
    Last Post: 02-29-2012, 08:29 AM
  5. Help with SQL: Birthdays in Next 30 days
    By kaylachris in forum Queries
    Replies: 1
    Last Post: 06-21-2010, 05:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums