{"id":66,"date":"2010-07-13T20:23:36","date_gmt":"2010-07-13T20:23:36","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=66"},"modified":"2022-02-17T07:14:15","modified_gmt":"2022-02-17T07:14:15","slug":"specifying-values-in-statements","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/sql-server\/queries-microsoft-sql-server\/statements-general\/specifying-values-in-statements","title":{"rendered":"Specifying Values In Statements"},"content":{"rendered":"<h4>Numeric Values<\/h4>\n<p>Simply use the value as is:<\/p>\n<pre><code>\"WHERE SomeFieldName=4\"<\/code><\/pre>\n<h4>Text Values<\/h4>\n<p>Surround the value in single qutoes:<\/p>\n<pre><code>\"WHERE SomeFieldName=\\'This Is The Value\\'\"<\/code><\/pre>\n<p>When you need to include single quotes in the string (e.g. &#8216;St Mary&#8217;s&#8217;) use a doudle single quote.  E.g. in VC++:<\/p>\n<pre><code>\r\n\tNewString = NewString->Replace(\"\\'\", \"\\'\\'\");\t\/\/Replace all ' with '' (needed if string you are trying to save contains a quotation mark\r\n<\/code><\/pre>\n<h4>Boolean Values<\/h4>\n<p>Surround the word True or False with single quotes:<\/p>\n<pre><code>\r\n\"WHERE SomeFieldName=\\'True\\'\"\r\n\"WHERE SomeFieldName=\\'False\\'\"\r\n<\/code><\/pre>\n<p>To use a VC++ boolean variable just use ToString:<\/p>\n<pre><code>\r\n\"...SET SomeFieldName=\\'\" + Convert::ToString(MyBooleanVariable) + \"\\' WHERE...\"\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Numeric Values Simply use the value as is: &#8220;WHERE SomeFieldName=4&#8221; Text Values Surround the value in single qutoes: &#8220;WHERE SomeFieldName=\\&#8217;This Is The Value\\'&#8221; When you need to include single quotes in the string (e.g. &#8216;St Mary&#8217;s&#8217;) use a doudle single quote. E.g. in VC++: NewString = NewString->Replace(&#8220;\\'&#8221;, &#8220;\\&#8217;\\'&#8221;); \/\/Replace all &#8216; with &#8221; (needed if [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-statements-general"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":10,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":1500,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/66\/revisions\/1500"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}