Many thanks for the link. I've been trying to adapt the code to my file. However, with only being a beginner I'm really struggling. I fully realise people won't have the time. However, if anyone does, I would be so grateful if they please could look at my file I attached on my original post and update where necessary to make it work. Many thanks
Thanks again for your help. It works perfectly for the Latitude and Longitude points. I want to use this in regards to consultants who claim mileage for trips. They enter a start and end postcode. I did a test with the postcodes in the attached file:
- Latitude and Longitude – 71.794 km
- Start and End Postcodes – 85.3 km
I noticed 85.3 km is in the field ‘Google XML Result’. Is there a way of pulling this (or whatever the figure is) out into another field please? No problem if is this not possible.
Duncan, there are a several of ways to parse the XML. The way I did it in #3 above is the quick and dirty way. It works for what you needed but it is not very flexible/elegant/powerful/etc.
A better method, in no particular order:
1. Use a custom function. Here are a few on Brian Dunning's site.
3. Use XSLT. A case for using XSLT is made here (and probably a few other places).
I have the Base Elements plugin, so if you'd like to use that plugin, the following should work:
BE_XPath ( CONTACTS::Google XML Result ; "/DirectionsResponse/route/leg/distance/text" )
Hi Daniel. Many thanks for your latest post above. I've now managed to get the mileage between two postcodes. Thanks again.