Hello,
I am storing lattitude in sql server as below format like 12°20'30". But now i want to split the lattitude in sql server like 12 DEG 20 MIN 30 SEC. Please provide me the solution
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jefferson S. MottaRank #207 · 11.7K reputationPosted Feb 9, 2019, 1:50 AM EST
select substring('12°20''''30"',1,2) + ' DEG ' as fld1,
substring('12°20''''30"',4,2) + ' MIN ' as fld2,
substring('12°20''''30"',8,2) + ' SEC' as fld3) t;
select substring(YOURFIELD,1,2) + ' DEG ' as fld1,
substring(YOURFIELD,4,2) + ' MIN ' as fld2,
substring(YOURFIELD,8,2) + ' SEC' as fld3) t
select substring('12°20''''30"',1,3) as fld1,
substring('12°20''''30"',4,3) as fld2,
select substring(YOURFIELD,1,3) as fld1,
substring(YOURFIELD,4,3) as fld2,
substring(YOURFIELD,8,3) as fld3;