I had a programming issue with VB.NET. I was getting an error for distance. In VB.NET it was being dispayed as -1.#IND although in CrystalReports it was shown slightly differently with a J in the answer. I believe that IND stands for INDETERMINANT. The equation I am using that causes the problem is :-
temp = Math.Acos(p1 + p2 + p3) * 6378
When I added up p1, p2 and p3 I got a response of 1.0000000000000002
And that is the problem. ACOS only allows -1 to +1, the software refused to work properly. Adding some error checking fixed the problem!