Paradox date filter lazarus / 16-Databases ---------------------------------------------------------------------- tawfiq-lz · 2025-11-08 03:40 hello guys , So i have a little app in lazarus and i am forced to retreive some informations from a Paradox database (table), i am trying to use a filter on some date field ( stored in paradox as date ) .. i tried all those lines .. but no one works : -PrdxDataset1.Filter:='DATE_FICHE = "2025/05/03"'; -PrdxDataset1.Filter:='DATE_FICHE = "03/05/2025"'; -PrdxDataset1.Filter:='DATE_FICHE = #2025/05/03#'; -PrdxDataset1.Filter:='DATE_FICHE = #03/05/2025#'; -PrdxDataset1.Filter:='DATE_FICHE =' +  QuotedStr(2025/05/03); -PrdxDataset1.Filter:='DATE_FICHE = "20250503"'; -PrdxDataset1.Filter:='DATE_FICHE = "03052025"'; please help me !! ---------------------------------------------------------------------- bytebites · 2025-11-08 07:25 Just a guess PrdxDataset1.Filter:='DTOS(DATE_FICHE) = "20250503"'; ---------------------------------------------------------------------- tawfiq-lz · 2025-11-09 13:29 Quote from: bytebites on November 08, 2025, 08:25:44 amJust a guess PrdxDataset1.Filter:='DTOS(DATE_FICHE) = "20250503"'; didnt work too ---------------------------------------------------------------------- dsiders · 2025-11-09 16:21 Quote from: bytebites on November 08, 2025, 08:25:44 amJust a guess PrdxDataset1.Filter:='DTOS(DATE_FICHE) = "20250503"'; Another guess... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PrdxDataset1.Filter := 'DTOS(DATE_FICHE) = ' + QuotedStr('#03/25/2025#'); ---------------------------------------------------------------------- tawfiq-lz · 2025-11-09 16:31 Quote from: dsiders on November 09, 2025, 05:21:48 pmQuote from: bytebites on November 08, 2025, 08:25:44 amJust a guess PrdxDataset1.Filter:='DTOS(DATE_FICHE) = "20250503"'; Another guess... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PrdxDataset1.Filter := 'DTOS(DATE_FICHE) = ' + QuotedStr('#03/25/2025#'); didnt work too ---------------------------------------------------------------------- paweld · 2025-11-09 17:10 Try; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PrdxDataset1.Filter := 'year(DATE_FICHE)=2025 AND month(DATE_FICHE)=5 AND day(DATE_FICHE)=3';PrdxDataset1.Filtered := True; ---------------------------------------------------------------------- tawfiq-lz · 2025-11-09 17:27 Quote from: paweld on November 09, 2025, 06:10:16 pmTry; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PrdxDataset1.Filter := 'year(DATE_FICHE)=2025 AND month(DATE_FICHE)=5 AND day(DATE_FICHE)=3';PrdxDataset1.Filtered := True; thanx for the try , but it didnt work too .. i think the problem is in this TParadoxDataSet ---------------------------------------------------------------------- wp · 2025-11-09 17:53 Maybe you should be more specific on how you opened the paradox database: ODBC? The paradox component which comes with Lazarus (components/paradox)? The TParadoxDataset from CCR (or OPM)? I am using the latter one occasionally for viewing old paradox files and/or converting them to sqlite3 (https://github.com/wp- xyz/ParadoxViewer). Trying now to filter records I am stuck with the same issue: Filtering works for string or integer fields (ParadoxDataset.Filter := 'StringField="A*"';), but fails for date fields, just as you are reporting. I noticed that filtering goes through the TBufdataset expression engine and thus should comply to the same rules working for example TDbf, such as the expression ParadoxDataset.Filter := 'DTOS(DateField)="20001231". Interestingly this one does not raise an expression, but leaves an empty row in my DBGrid, and finally the application crashes when the mouse is moved into the grid so that it must be redrawn (*). I speculate that TParadoxDataset has an issue here? What certainly is working for sure is to provide a handler for the OnFilterRecord event: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ParadoxDataset1FilterRecord(DataSet: TDataSet;  var Accept: Boolean);var  dt: TDate;begin  dt := Dataset.FieldByName('DateField').AsDateTime;  Accept := (dt = EncodeDate(2000,12,31));end; (*) I just have been able to fix this: The crash happened when a popup hint would appear over the empty grid row when the filter had returned only an empty dataset. In dbgrids.pas, the line "if (F <> nil)" must be extended to "if (F <> nil) and not F.IsNull" in function TCustomDBGrid.GetTruncCellHintText. ---------------------------------------------------------------------- tawfiq-lz · 2025-11-09 18:46 thanx alot  wp yourcode worked for me .