Thanks! I am working on normalizing the phone numbers... its gonna take awhile.. :-)
----- Original Message ----- From: "Jochem van Dieten" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, June 13, 2003 3:19 PM Subject: Re: phone numbers - update on previous problem > Michael Tangorre wrote: > > Basically I just wanted to re-open my issue and it is bigger than I first imagined... > > > > anyways, has anyone tried to calculate using any language, what country a phone number relates to? Basically I thought I had it until I realized that some country codes overlap if the ones being compared are 2 digits and some are 3 digits, etc.... > > Store all the country codes in a database. Presuming a table named > countrycodes with the fields code and country, you can pull out the the > right one using: > > SELECT cc.country > FROM countrycodes cc > WHERE cc.code = substring(<cfqueryparam cfsqltype="cf_sql_varchar" > value="#form.phonenumber#"> FROM 1 FOR character_length(cc.code)) > ORDER BY character_length(cc.code) DESC > > Check the manual if your database does not support this standard SQL > syntax. If it pulls out more as one country, you need the first one. > > Remember you still need to normalize the phonenumbers first. I strongly > recommend to use the format from ITU E.164 for storing phone numbers, it > is forward compatible. > > Jochem > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

