Forum > Databases
How to reset TDBDateTimePicker?
(1/1)
loaded:
Hi All,
In my current database, records with date type initially show as "00.00.0000". So far, no problem.
However, after a change in the relevant record, it is not possible to revert the date to "00.00.0000".
I can do this with SQL. But is it possible to reset it directly via TDBDateTimePicker?
rvk:
--- Quote from: loaded on May 30, 2022, 01:43:19 pm ---In my current database, records with date type initially show as "00.00.0000". So far, no problem.
However, after a change in the relevant record, it is not possible to revert the date to "00.00.0000".
I can do this with SQL. But is it possible to reset it directly via TDBDateTimePicker?
--- End quote ---
00.00.0000 isn't a valid date, is it?
Why are you not working with NULL for empty or unspecified dates in your database?
It is possible to set a TextForNullDate. You could set it to 00.00.0000.
But before writing it to the database you would need to change the NULL-value to 00.00.0000.
( or better yet, switch to null on screen and in the database )
O wait. That's TDBDateEdit. With TDBDateTimePicker you can't enter an invalid date, period.
O, but you can set it to NULL.
loaded:
First of all, thank you very much for your reply Rvk.
--- Quote from: rvk on May 30, 2022, 02:01:17 pm ---00.00.0000 isn't a valid date, is it?
--- End quote ---
Yes, it is not a valid date. It just helps me perceive it visually faster.
What I'm wondering is why TDBDateTimePicker can show the invalid date initially, but not the same value afterwards?
--- Quote from: rvk on May 30, 2022, 02:01:17 pm ---Why are you not working with NULL for empty or unspecified dates in your database?
--- End quote ---
I think it would be better if I did as you said. Respects.
Navigation
[0] Message Index