{"id":489,"date":"2010-11-05T20:20:10","date_gmt":"2010-11-06T01:20:10","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=489"},"modified":"2021-03-10T18:01:38","modified_gmt":"2021-03-10T23:01:38","slug":"powerbuilder-datawindow-filter-on-a-datetime-column","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-datawindow-filter-on-a-datetime-column\/","title":{"rendered":"PowerBuilder &#8211; Datawindow Filter on a datetime column"},"content":{"rendered":"<p>A question came in on the TekTips Powerbuilder forum regarding filtering on a datetime column in a datawindow.  Basically the problem was a &#8216;type mismatch&#8217; error when trying to filter this type of column.  This is how the author was setting the filter:<\/p>\n<pre>&lt;code&gt; ls_filter = &quot;ls_column_name= &#039;11\/10\/2010 12:30:00&#039;&quot;\nor ls_filter = &quot;ls_column_name= &#039;&quot; + ls_dateval + &quot;&#039;&quot;&lt;\/code&gt;\n&lt;pre&gt;\nThe answer is to convert the column data value to the same format as being tested for.\n\n&lt;pre name=&quot;code&quot; class=&quot;VB&quot;&gt;ls_filter = &quot;string(&quot; + ls_column_name + &quot;, &#039;mm\/dd\/yyyy hh:mm:ss)&#039; = &#039;11\/10\/2010 12:30:00&#039;&quot; \nor ls_filter = &quot;string(&quot; + ls_column_name + &quot;, &#039;mm\/dd\/yyyy hh:mm:ss)&#039; = &#039;&quot; + ls_dateval + &quot;&#039;&quot;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A question came in on the TekTips Powerbuilder forum regarding filtering on a datetime column in a datawindow. Basically the problem was a &#8216;type mismatch&#8217; error when trying to filter this type of column. This is how the author was setting the filter: &lt;code&gt; ls_filter = &quot;ls_column_name= &#039;11\/10\/2010 12:30:00&#039;&quot; or ls_filter = &quot;ls_column_name= &#039;&quot; +&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[21,12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/489"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=489"}],"version-history":[{"count":7,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/489\/revisions"}],"predecessor-version":[{"id":1882,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/489\/revisions\/1882"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}