Forum

Please or Register to create posts and topics.

Hide event descriptions with specific text

Several years ago, someone wrote a script for me to be able to hide residence fact descriptions that contained specific text.  The point of it was to eliminate the text from census records (such as "Relation to Head") so that it would not print out on reports.  Some residence facts have other text in the description that I want to keep (such as "with his mother" or "next door to his sister".

I have lost the script and am hoping one of you brilliant SQL gurus can recreate it for use with RM10.

The only part of the script I still have is below, if that helps 🙂

Jaime

LIKE '%Age%' OR
LIKE '%StreetAddress%' OR
LIKE '%Residence Post Office%' OR
LIKE '%Marital Status%' OR
LIKE '%GradeCompleted%' OR
LIKE '%OccupationCategory%' OR
LIKE '%Occupation%' OR
LIKE '%EnumerationDistrict%' OR
LIKE '%AttendedSchool%' OR
LIKE '%ClassofWorker%' OR
LIKE '%Relation to Head%' OR
LIKE '%PartyAffiliation:%' ;

There should not be anything in the script that is different between RM7 and RM10. If you still had the entire script from RM7, it should continue to work in RM10.

On the other hand, without the entire script I'm not sure I can recreate it because I don't understand exactly what it is trying to do. I'm assuming you would only run this script in a copy of your database you were using for reporting, because the script probably would be destructive. And I'm guessing that you would want to just blank out the Description field for the Residence fact. If so, then this is my guess.

UPDATE EventTable
SET Details = ''
WHERE EventType = 29    /*  Residence fact   */
AND Details LIKE   (all the conditions you listed in your post)

I'm now a little confused because there was a second message that did include the full RM7 script. It appears to be based on the Note field rather than the Desciption field.  Here is the full script that was posted. There is no reason it shouldn't work in RM10. But do realize that it's destructive and should only be used on a copy of your database you are using for reporting, not in your production database.

UPDATE EventTable
SET Note = ''
WHERE Note LIKE '%Census' OR
Note LIKE '%Age:%' OR
Note LIKE '%StreetAddress:%' OR
Note LIKE '%Residence Post Office:%' OR
Note LIKE '%Marital Status:%' OR
Note LIKE '%GradeCompleted:%' OR
Note LIKE '%OccupationCategory:%' OR
Note LIKE '%Occupation:%' OR
Note LIKE '%EnumerationDistrict:%' OR
Note LIKE '%AttendedSchool:%' OR
Note LIKE '%ClassofWorker:%' OR
Note LIKE '%Relation to Head%' OR
Note LIKE '%Age in %' OR
Note LIKE '%PartyAffiliation:%';

The background to this discussion is in here

Thank you Tom, I searched the forum for it but could not find it and figured it had been in an email that I lost.

Appreciate your excellent memory 🙂

Thanks Jerry - I was getting confused myself!  Luckily Tom remembered or had better luck finding the original script that was written for the description 🙂

Take care!

Thanks again to Tom Holden and Jerry Bryan!  For those who want to eliminate the census data that Treeshare puts into the Residence description, here is the finalized script.

Uploaded files: