ListView QuickSearch cannot search or filter on a DateTime type column

  • 16 February 2021
  • 0 replies
  • 102 views

Userlevel 5
Badge +20
 

ListView QuickSearch cannot search or filter on a DateTime type column

kbt141429

PRODUCT
K2 smartforms
BASED ON
K2 smartforms (all)
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

Quick search is not possible on a DateTime type column. This is due to the way the data is encoded which cannot be parsed by the quick search.

Symptoms

1. When searching by date, there is no result even though there is information for that keyed in date. 

 

Image

 

2. When keyed in the date in same format as a displayed date column.

Image

Resolution

Workaround
Use a store procedure that converts the DateTime column to text before it is sent to the view.

The SQL to be implemented is as follows:

 

SELECT CONVERT(VARCHAR(11), GETDATE(), 106) AS [DD MON YYYY]

 

Where getdate() should be replaced with selecting your column.

 

Example result:

Image


0 replies

Be the first to reply!

Reply