This is a migrated thread and some comments may be shown as answers.

DATE and DATETIME column problem

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 08 Aug 2018, 06:30 AM

Hi,

I adds a DATE column (created date of the record) into KendoUI grid, but the database format of column is DATETIME, because, I need to know also time. Problem is, when Im using filtering functionality, because when I would like to filter this column to date = for example 2018-08-08 and Im sure, that some records was created on this day, datagrid do not fond nothing. Its because, the datagrid is searching for 2018-08-08 00:00:00 and no record exists with a zero time.

 

Is there any way to solve this problem in datagrid or, there is needed to create two columns in the database, one as a DATETIME and second as a DATE. I have problem also with the WEEK number (I opened another discussion thread). If I need to add also the week number, I need to have 3 columns in the database for one information: DATETIME, DATE, WEEK. I think, its poor solution. Do you have any other ideas?

 

Thanks for help.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 09 Aug 2018, 03:21 PM
Hello Jan,

Depending on whether your Grid can use client-side filtering, there are alternative solutions to this problem. The main two are described in this help article:
Filter by Date Only

The first will work only if the Grid DataSource uses client-side filtering. If not, you could try the second listed solution—to use two filter expressions (greater than beginning of day and less than end of day) instead of a single one (equal to beginning of day) when the user selects the equals filter.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Jan
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or