Luigi Siciliano wrote 21.03.2025 17:49:
> I need in a stored procedure of firebird v. 2.5.9 to compare a date and if needs construct a date like Delphi EncodeDate(dd, mm, yyyy).
Don't fall into "XYZ problem" trap, express what you really need, not the way
you want to get it.
> I have a DateField with a '23.05.2025' value i need to change it in
> '01.01.2025'
> I have a DateField with a '03.11.2025' value i need to change it in
> '01.07.2025'
Looks like you need the first day of half-year. Modern versions of Firebird
provide function FIRST_DAY() but with ancient version 2.5 you are limited to
something like this:
dateadd(extract(month from DateField) / 2 month to
(DateField - extract(yearday from DateField))
--
WBR, SD.