Attached death certificate

1 vote

Attached death certificate

I am trying to find/create a query that will give me a list of everyone who has a death certificate attached.
momakid momakid shared this idea

2 Replies to “Attached death certificate”

  1. I found a query that I was able to alter and get what I wanted. Here is the query:
    — everyone with a death certificate attached

    select nt.surname,
    nt.given,
    et.ownerid,
    nt.birthyear,
    nt.deathyear,
    –ft.Name,
    –substr(et.date,4,4) as Ev_Date,
    mm.Caption AS Caption,
    mm.MediaPath AS Path,
    mm.MediaFile AS File,
    mm.thumbnail,
    nt.IsPrimary

    from eventtable et

    JOIN facttypetable ft ON et.eventtype = ft.facttypeid
    JOIN nametable nt ON et.ownerid = nt.ownerid
    LEFT JOIN placetable pt USING(PlaceID)
    left join placetable as site on et.siteid = site.placeid
    left join medialinktable as ml on et.eventid = ml.ownerid and ml.ownertype = 2
    LEFT JOIN MultiMediaTable MM USING(MediaID)

    where mm.mediapath like “%Death Certificates”
    –and nt.IsPrimary = 0 — for primary records only

    order by et.ownerid, nt.isprimary desc
    ;

Comments are closed.