{"id":960,"date":"2013-03-01T19:55:50","date_gmt":"2013-03-01T14:55:50","guid":{"rendered":"http:\/\/www.esearing.com\/v2010\/?p=960"},"modified":"2013-03-01T20:17:03","modified_gmt":"2013-03-01T15:17:03","slug":"coldfusion-error-value-cannot-be-converted-to-a-number","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2013\/03\/coldfusion-error-value-cannot-be-converted-to-a-number\/","title":{"rendered":"Coldfusion Error &#8211; value cannot be converted to a number"},"content":{"rendered":"<p>Here is a message that comes up often in CF error messages that is sometimes tough to figure out. <\/p>\n<p><code>The value '' cannot be converted to a number.<\/code><br \/>\nThis usually indicates that a Null value (ie record is missing a rowid, userid, phoneNbr, or dateadd calculation) is being converted to a number and CF doesn\u2019t allow Null to Number. It is usually buried in a SQL statement like the following.<\/p>\n<p><code>Select a.*, b.user_email, c.geo_region<br \/>\nfrom orders a, users b, states c<br \/>\nwhere a.user_id = b.user_id<br \/>\nand convert(numeric b.billing_zipcode) = convert(numeric, c.zipcode)<\/code><br \/>\nIF billing_zipcode in Table USERS is not numeric(ie Null, a space, or contains non-numeric data) the join fails and throws an error. <\/p>\n<p>The key part of any error for conversion is to look at the type: &#8220;Converted to a Number&#8221; vs &#8220;Converted from Int to VAR CHAR&#8221;, Then find that conversion in your SQL or CF formats. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a message that comes up often in CF error messages that is sometimes tough to figure out. The value &#8221; cannot be converted to a number. This usually indicates that a Null value (ie record is missing a &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2013\/03\/coldfusion-error-value-cannot-be-converted-to-a-number\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,24],"tags":[],"class_list":["post-960","post","type-post","status-publish","format-standard","hentry","category-problems-fixes","category-snippets-quick-code-tips-for-single-elements-attributes-or-details"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=960"}],"version-history":[{"count":3,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/960\/revisions"}],"predecessor-version":[{"id":963,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/960\/revisions\/963"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}