Format date in database grid
The date value is the Delphi tDateTime value stored as a double in LiteDac dataset field 1. In a test dataset with four records, the date values are stored as 43000, 43000.2, 43096 and 43096.1. Time of day is not needed, only the date.
This test instruction works, and proves the four double float values can be accurately retrieved from the dataset:
tNumericField(fmOpen.dbgDateList.DataSource.Dataset.Fields).DisplayFormat := '#,##0.0000';
This instruction does not work (the displayed date value in grid column is literally dd/mm/yyyy for every record in the query result):
tDateTimeField(fmOpen.dbgDateList.DataSource.Dataset.Fields).DisplayFormat := 'dd/mm/yyyy'
I am using D14 (2009). I have tested my D14 version of Delphi using the console test posted in this forum by MaximG on Wed 13 Jan 2016 14:31. D14 correctly formats the date and time in the console output.
Since I know that Delphi can retrieve the date value as a numeric, the formatting problem appears to be within the tDateTimeField formatting instruction when it is applied to a LiteDAC component dataset.
The grid is used for display and selection purposes, and no value (date or otherwise) is edited directly within the grid.
Any help would be appreciated. I have a simple Delphi app and simple SQLite3 database used to test the date value formatting, and I am happy to share it.