Places - Checking for Country
Posted: 06 Nov 2019 12:59
Every month I run a set of queries looking for various errors.
One of these checks that I have a valid Country in 'Places'.
Now because the country name could appear in any of 4 levels I need to check each of those places.
e.g.
Brazil
Essex, England
Liverpool, Lancashire, England
Beckside, Kirby Ireleth, Lancashire, England
So my query looks at all 'Places' but excludes those that have a valid country:
Exclude if =TextPart(%_PLAC%,1,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,2,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,3,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,4,1,STD)matches 'Australia'
This is obviously repeated for every country that is in use.
The result is a list of 'Places' created without a Country name - or with a new one.
My existing query works fine, but I've just imported some new records with places missing country or have a previously unknown one, and I have to modify it and thought it may be right time to see if anyone had a better idea.
Many thanks
One of these checks that I have a valid Country in 'Places'.
Now because the country name could appear in any of 4 levels I need to check each of those places.
e.g.
Brazil
Essex, England
Liverpool, Lancashire, England
Beckside, Kirby Ireleth, Lancashire, England
So my query looks at all 'Places' but excludes those that have a valid country:
Exclude if =TextPart(%_PLAC%,1,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,2,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,3,1,STD)matches 'Australia'
Exclude if =TextPart(%_PLAC%,4,1,STD)matches 'Australia'
This is obviously repeated for every country that is in use.
The result is a list of 'Places' created without a Country name - or with a new one.
My existing query works fine, but I've just imported some new records with places missing country or have a previously unknown one, and I have to modify it and thought it may be right time to see if anyone had a better idea.
Many thanks