Forum > General
How to display empty string instead of 30.12.1899 in case of NULL date
krzynio:
Hello!
How to display empty string in TDBDateEdit instead of 30.12.1899 in case of NULL or zero date?
30.12.1899 looks inelegant.
Lazarus 3.6 on Windows 11.
Zvoni:
--- Quote from: krzynio on November 22, 2024, 12:22:15 pm ---Hello!
How to display empty string in TDBDateEdit instead of 30.12.1899 in case of NULL or zero date?
30.12.1899 looks inelegant.
Lazarus 3.6 on Windows 11.
--- End quote ---
What's the SQL-Statement looks like?
paweld:
Use TDBDateTimePicker (the DateTimeCtrls package) instead of TDBDateEdit.
wp:
The attached project demonstrates that TDBEdit is able to display an empty field, but only when the field is null.
TDBDatePicker, on the other hand, has the issue that it ignores an empty string in its TextForNullDate property and displays a "zero" date ("00.00.0000"). This can be fooled, however, by setting TextForNullDate to a space character.
Zoran:
--- Quote from: wp on November 22, 2024, 11:53:38 pm ---TDBDatePicker, on the other hand, has the issue that it ignores an empty string in its TextForNullDate property and displays a "zero" date ("00.00.0000"). This can be fooled, however, by setting TextForNullDate to a space character.
--- End quote ---
This is not an issue, but it is by design and documented:
--- Quote ---If you want empty display, this can be achieved by setting TextForNullDate to one or more space characters.
--- End quote ---
Navigation
[0] Message Index
[#] Next page