Filter string for TDateTime field - TCRDBGrid

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Filter string for TDateTime field - TCRDBGrid

Post by ertank » Thu 21 Jan 2016 10:40

Hi,

I am using MSSQL Express as a database. I have a TCRDBGrid which its columns are dynamically set during run-time. One of the columns linked to a "date" datatype field on MSSQL.

There are some records with "date" field set to NULL in the MSSQL database. I want my users to be able to filter NULL records (or empty records) for a "date" field using provided CRDBGrid filter property at run-time. Is this possible? If yes, what should filter string look like?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Filter string for TDateTime field - TCRDBGrid

Post by AlexP » Thu 21 Jan 2016 11:51

Hello,

In order to filter by empty (NULL) fields, you should add the NULL word in the filter field.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: Filter string for TDateTime field - TCRDBGrid

Post by ertank » Thu 21 Jan 2016 14:55

My bad. Both upper case and lower case NULL is working. I hit another bug explained here.

http://forums.devart.com/viewtopic.php?f=28&t=33025

That's why my trials were producing error messages. Modified column names and all good now.

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Filter string for TDateTime field - TCRDBGrid

Post by AlexP » Tue 26 Jan 2016 08:28

Glad to see that you solved the problem. If you have any other questions, feel free to contact us

Post Reply