StateAbbrev ( state )
Given a USA or Canadan state name, returns corresponding two letter USPS code
Average rating: 4.6 (23 votes) Log in to vote
L. Allen Poole - Show more from this author
Creative Database Solutions NW
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
If state name is not recognized, it's returned verbatim.
|François Goulet, Montreal, QC Canada
Dec 12, 2014
It looks like you forgot the canadian province of New-Brunswick in your CF...
FYI, in Canada we have 2 official languages - French and English. French is predominant in the province of Quebec (population: 8 million - about 23% of the total canadian population). Since I often have to create multilingual UIs I modified your custom function to integrate the french version of the provinces names...Hence the following changes in the "state" items :
state = "British Columbia" or state = "Colombie-Britannique"; "BC";
state = "Prince Edward Island" or state = "Île-du-Prince-Édouard"; "PE";
state = "New Brunswick" or state = "Nouveau-Brunswick"; "NB";
state = "Nova Scotia" or state = "Nouvelle-Écosse" ; "NS" ;
state = "Quebec" or state = "Québec" ; "QC" ;
state = "Newfoundland and Labrador" or state = "Terre-Neuve-et-Labrador" ; "NL" ;
state = "Northwest Territories" or state = "Territoires du Nord-Ouest" ; "NT" ;
Please note that other canadian provinces are the same in french as in english...
Thanks for your CF and have a great day,
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.