title: How to fix SQL server JSON_VALUE path has '-' error
body: <p>I'm trying to get values of fields in sql that is in JSON type. unfortunately path has '-' so that I get an error when I try to get the value.</p>
  <pre><code>field-&gt;** **{&quot;Con&quot;:[&quot;AA&quot;],&quot;X-Location-Latitude&quot;:[&quot;55.06&quot;]}
  </code></pre>
  <p>When I try to get json value with below query</p>
  <pre><code>SELECT JSON_VALUE(field, '$.X-Location-Latitude') 
  FROM table
  </code></pre>
  <p>I get this error</p>
  <blockquote>
  <p>Json path is not properly formatted unexpected character '-' is found</p>
  </blockquote>
  <p>I also tried adding double quotes as</p>
  <pre><code>SELECT JSON_VALUE(field, '$.&quot;X-Location-Latitude&quot;') 
  FROM table
  </code></pre>
  <p>and this returned NULL.</p>
  <p>Does anyone have a solution?</p>