{"id":1708,"date":"2011-11-14T12:35:19","date_gmt":"2011-11-14T16:35:19","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=1708"},"modified":"2011-11-11T12:43:34","modified_gmt":"2011-11-11T16:43:34","slug":"arithmetic-overflow-error-converting-expression-to-data-type-datetime","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2011\/11\/arithmetic-overflow-error-converting-expression-to-data-type-datetime\/","title":{"rendered":"Arithmetic overflow error converting expression to data type datetime"},"content":{"rendered":"<pre>\r\n<strong>Condition:<\/strong>\r\n<code>\r\n&lt;asp:SqlDataSource ID=\"PolExpCurrentMo\" runat=\"server\" \r\n  ConnectionString=\"< %$ ConnectionStrings:appConnectionString2 %>\" \r\n  SelectCommand=\"SELECT * FROM [VendorList] WHERE \r\n              _([EXPIRATION_DATE] >= @EXP_BEGIN) AND ([EXPIRATION_DATE] < @EXP_END) AND \r\n              _([EXPIRATION_CONTACT] = @EXPIRATION_CONTACT) ORDER BY EXPIRATION_DATE \">\r\n  &lt;selectparameters>\r\n     &lt;asp:parameter DefaultValue=\"YES\" Name=\"EXPIRATION_CONTACT\" Type=\"String\" \/>\r\n     &lt;asp:parameter Name=\"EXP_BEGIN\" Type=\"String\"\/>\r\n     &lt;asp:parameter Name=\"EXP_END\" Type=\"String\" \/>\r\n  &lt;\/selectparameters>\r\n<\/code>\r\n<i>Code behind default value<\/i>\r\n<code>\r\n' *current months date parameter \r\nPolExpCurrentMo.SelectParameters(\"EXP_BEGIN\").DefaultValue = \r\n_DateTime.Now.Month.ToString() + \"\/1\/\" + DateTime.Now.Year.ToString() 'month begins\r\n\r\nPolExpCurrentMo.SelectParameters(\"EXP_END\").DefaultValue = \r\n_NxMonthValue + \"\/1\/\" + DateTime.Now.Year.ToString() 'month ends\r\n<\/code><code>\r\n<\/code>\r\n<\/pre>\n<pre>\r\n<strong>Resolution<\/strong>\r\n<code>\r\n&lt;asp:SqlDataSource ID=\"PolExpCurrentMo\" runat=\"server\" \r\n  ConnectionString=\"< %$ ConnectionStrings:appConnectionString2 %>\" \r\n  SelectCommand=\"SELECT * FROM [VendorList] WHERE \r\n              _([EXPIRATION_DATE] >= @EXP_BEGIN) AND \r\n              _((convert(varchar,[EXPIRATION_DATE],111)) < @EXP_END) AND \r\n              _((convert,[EXPIRATION_CONTACT],111)) = @EXPIRATION_CONTACT) ORDER BY \r\n              _EXPIRATION_DATE \">\r\n  &lt;selectparameters>\r\n     &lt;asp:parameter DefaultValue=\"YES\" Name=\"EXPIRATION_CONTACT\" Type=\"String\" \/>\r\n     &lt;asp:parameter Name=\"EXP_BEGIN\" Type=\"String\"\/>\r\n     &lt;asp:parameter Name=\"EXP_END\" Type=\"String\" \/>\r\n  &lt;\/selectparameters>\r\n<\/code>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Condition: &lt;asp:SqlDataSource ID=&#8221;PolExpCurrentMo&#8221; runat=&#8221;server&#8221; ConnectionString=&#8221;< %$ ConnectionStrings:appConnectionString2 %>&#8221; SelectCommand=&#8221;SELECT * FROM [VendorList] WHERE _([EXPIRATION_DATE] >= @EXP_BEGIN) AND ([EXPIRATION_DATE] < @EXP_END) AND _([EXPIRATION_CONTACT] = @EXPIRATION_CONTACT) ORDER BY EXPIRATION_DATE \"> &lt;selectparameters> &lt;asp:parameter DefaultValue=&#8221;YES&#8221; Name=&#8221;EXPIRATION_CONTACT&#8221; Type=&#8221;String&#8221; \/> &lt;asp:parameter Name=&#8221;EXP_BEGIN&#8221; Type=&#8221;String&#8221;\/> &lt;asp:parameter Name=&#8221;EXP_END&#8221; Type=&#8221;String&#8221; \/> &lt;\/selectparameters> Code behind default value &#8216; *current months date parameter PolExpCurrentMo.SelectParameters(&#8220;EXP_BEGIN&#8221;).DefaultValue = _DateTime.Now.Month.ToString() + [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,17,75],"tags":[19],"class_list":["post-1708","post","type-post","status-publish","format-standard","hentry","category-application-error","category-applications","category-error","tag-asp-net"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1708"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=1708"}],"version-history":[{"count":16,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1708\/revisions"}],"predecessor-version":[{"id":1724,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/1708\/revisions\/1724"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=1708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=1708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=1708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}