Page 1 of 1
Using Database manager
Posted: Fri Dec 28, 2018 3:51 pm
by John Dykema
We use Date 6 and renamed it Deceased. We also keep dates when people come in (In-Date, Date 5) and when they leave (Out-date, Date 7).
I've discovered we have over 100 deceased people but the Out-date has been left blank.
I want to make anyone with a Deceased date copied into the Out-date field. This will save me a lot of keying.
Could you give me the commands to do this? Yes, I will backup the database before trying this
Thanks much.
John
Re: Using Database manager
Posted: Fri Dec 28, 2018 6:11 pm
by Zorak
The first thing you will need to know is what two digit Personal Status code represents "Deceased". You can find that by doing the following:
Code: Select all
USE MECODES
BROW FOR FIELD="STATUS" AND UPPER(DESCRIPT)="DECEASED"
We'll call that code value ZZ for this example. The next step will be first to run a query to make sure you get the list of records you are expecting.
Code: Select all
USE ME
BROW FOR STATUS="ZZ" AND NOT EMPTY(DATE6) AND EMPTY(DATE7)
You should see the list of over 100 deceased people with no Out-date assigned that you were seeing before. If not, then something is off in the logic and we'll need you to post back with more details. That query says the Personal Status code is "Deceased" and there is a Deceased date assigned, but no Out-date assigned.
If the list of people in that query is as you expected, do the following:
Code: Select all
REPL ALL DATE7 WITH DATE6 FOR STATUS="ZZ" AND NOT EMPTY(DATE6) AND EMPTY(DATE7)
That simply takes the same list of people from the last query and copies Deceased date into Out-date.
Re: Using Database manager
Posted: Fri Dec 28, 2018 9:44 pm
by John Dykema
Zorak, that worked slick as can be, what a time saver. Thanks much.
I then also tried to wipe out Date4 (renamed Married) with:
REPL ALL DATE4 WITH " " FOR STATUS ="DN" but then I get a data error. I also tried " / / " but no go. Could that be because dates are numeric fields? Please advise.
Re: Using Database manager
Posted: Sat Dec 29, 2018 8:58 am
by Zorak
I don't have access to PowerChurch at the moment to try this, but I believe the blank date equivalent is {}
Re: Using Database manager
Posted: Sat Dec 29, 2018 10:50 am
by John Dykema
You're the man Zorak. I thought it was a zero but once I figured out they are brackets it worked like a charm.
Thanks much. John D.