G
Guest
I do not know how to perform the necessary math in a query for the following
situation.
I have a table in which I store coordinates for various places. The
coordinates, unfortunately, are stored in DD MM.MMM format. All the
coordinates are for North America. They are stored in two fields such as:
38° 37.501
090° 11.085
I need to convert them to DDD.DDDDD, which would yield:
38.625017
-90.18475
The formula to do that is:
split the degrees away from the decimals (38° as one string, 37.501 as
another)
divide the decimal part by 60 (37.501 / 60 = 625017)
combine it with the degree part with a decimal (38.625017)
A couple of considerations:
The west coordinate has three digits in the degrees, but the leading digit
is often a zero. Not certain that is a stumbling block, but wanted to point
it out.
Also, it is customary to indicate the west coordinate with a leading
negative symbol to distinguish it from the eastern hemisphere. No test is
needed to determine hemisphere; all will be west.
Can anyone lend a hand as to how to perfom this calculation in a query?
Thank you.
situation.
I have a table in which I store coordinates for various places. The
coordinates, unfortunately, are stored in DD MM.MMM format. All the
coordinates are for North America. They are stored in two fields such as:
38° 37.501
090° 11.085
I need to convert them to DDD.DDDDD, which would yield:
38.625017
-90.18475
The formula to do that is:
split the degrees away from the decimals (38° as one string, 37.501 as
another)
divide the decimal part by 60 (37.501 / 60 = 625017)
combine it with the degree part with a decimal (38.625017)
A couple of considerations:
The west coordinate has three digits in the degrees, but the leading digit
is often a zero. Not certain that is a stumbling block, but wanted to point
it out.
Also, it is customary to indicate the west coordinate with a leading
negative symbol to distinguish it from the eastern hemisphere. No test is
needed to determine hemisphere; all will be west.
Can anyone lend a hand as to how to perfom this calculation in a query?
Thank you.