PowerBuilder – Datawindow Filter on a datetime column
A question came in on the TekTips Powerbuilder forum regarding filtering on a datetime column in a datawindow. Basically the problem was a ‘type mismatch’ error when trying to filter this type of column. This is how the author was setting the filter:
<code> ls_filter = "ls_column_name= '11/10/2010 12:30:00'" or ls_filter = "ls_column_name= '" + ls_dateval + "'"</code> <pre> The answer is to convert the column data value to the same format as being tested for. <pre name="code" class="VB">ls_filter = "string(" + ls_column_name + ", 'mm/dd/yyyy hh:mm:ss)' = '11/10/2010 12:30:00'" or ls_filter = "string(" + ls_column_name + ", 'mm/dd/yyyy hh:mm:ss)' = '" + ls_dateval + "'"You might also be interested in