Hello, Since your field is of type STRING you need to add 3 colomns of FLOAT Call them say LATy and LONx
If your string is consistant as DDDMMmmm, then this will work [ sounds like a dump from a GPS in this format ? ] If you have blank values then you need to query the table for non-blank records into a table names say Work and the change the below MyTable to Work [select * from MyTable where sLat>"" and sLon>"" into Work] 1) copy the below as one line [no word wrapping from the mail] to the MapBasic Window 2) Change MyTable to the real table name and sLat and sLon to existing column names and LATy and LONx to the new names created above 3) then hit enter --------------------------Copy Start UPDATE MyTable SET LATy=val(left$(sLat,3) +( val( mid$(sLat,4,2)+"."+right$(sLat,3) ) /60 ), LONx=val(left$(sLon,3) +( val( mid$(sLon,4,2)+"."+right$(sLon,3) ) /60 ) ---------------------------Copy End Analysis 1) take the 2 chars [MM] at pos 4/5 [mid$(str,start,count)] 2) append the decimal +"."+ 3) append the right 3 chars [mmm] [right$(str,3)] 4) convert string to number [val(...)] 5) divide by 60 converting MM to .dddddd 6) add the value [val(....)] of the left 3 chars [left$(str,count)] 7) update the column [float laty or lonx] with the calculation Trey Pattillo -97.665333W 27.799121N www.wap3.com [EMAIL PROTECTED] ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 09, 2001 16:05 Subject: MI-L converting degree decimal minutes to decimal degrees > I have a table with Lat/Long fields that are in degree decimal minutes (ddd� > mm.mmm) , for example (09923081) which is 99� 23.081' > And I need to convert those lat/long fields to decimal degrees in order to use > the "create points" in MapInfo. But the only mbx programs I can find such as > Dms_dec.mbx and Dmscnvrt.mbx will only convert decimal degrees to degrees > minute seconds or vis-versa. Anyone know of an easy way of converting ddd�mm.mmm > to ddd.ddddddd automatically? > > TIA > > Dan > > > > > _______________________________________________________________________ > List hosting provided by Directions Magazine | www.directionsmag.com | > To unsubscribe, send e-mail to [EMAIL PROTECTED] and > put "unsubscribe MapInfo-L" in the message body. _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body.
