And yes, it is not NULL, but - sobb - '01.01.1800' (or símilar).It can never be that date. "similar" will give you the correct date.... as a valid default.
Your comments sometimes sound not too helpful to anybody.What Thaddy is (probably) alluding to: If Firebird follows common Database-conventions, the Date-Datatype is an alias for Integer, but allows to store Dates in ISO-Format Representation (!!)
dateField > '1.1.1960'is working as intended (It's not ISO-Format, it's not even proper "german" Format)
It returns 'dd.mm.yyyy,' which is the default setting of my computer.No it is not, it is a default display setting. The internal structure is still a double and UTC. You confuse it. I warned you.
Usually I do not touch the input or output data by Delphi (Lazarus).
I do it by ". byname... . AsDateTime", so IBX does it for me.
So what I need is this:So what was wrong with the CHECK dateField > '1.1.1960'?
- key in the field's check into Firebird by Flamerobin.
purpose:
hinder my software to write a date into my database which may be zero or - I just took it by chance - before 1.1.1960
@rvkYes. The dot notification usually does refer to DD.MM.YYYY in Firebird. But does it also in Windows?
Why shall I prefer '1960-01-01'
and of course this was a typo > '1.1.1960'?
correct is, that I wrote
> '01.01.1960'?
I did this, because this seems format of many conversion routines of all kinds as input and output including FlameRobin
To make it clear.0 en NULL are not the same thing in Firebird.
It is not about NULL / NIL, it is about zero.
If zero is the default value for not NIL, worsens the thing.
Testing this is really hard, because it takes about a quarter of an hour after having chosen "run", until I see anything.Mmm, then there is something really wrong. When I run my program (including Build) it comes up in about 10 seconds (and it is a really large program).
In German we say, "the hope is it, what dies at last".Maybe I am the only one here... but I find your question (or translation of it) really hard to understand.
What I hope(d): As Flamerobin checks the date and give correct results in "where" for e.g.
where datum > '10.11.2022'
Is there a chance, that it passes on to Firebird as well "meant" conditions? And "corrects" the format internally?
I am aware, that this where clauses accepts different strange inputs as well, I tried some (but got wrong results).
The "US-sample" would be possible, but answers one question and opens 1000 new ones. Believe me, you do not want to see this. I do not want to see it neither, but I have to.Maybe, but it would answer one very important question: If FB stores a date agnostic of locale representation (which would make so much sense!)
The error-message looks, as if the format settings (1960-01-01 and 1.1.1960 and 01.01.1960) would be "the same".Besides what Zvoni said about the duplicate constraint-name, you NEED to quote the date. The date isn't a field or constant. So you need to do
BTW. If there are dates before 01-01-1960 you will get an error committing this constraint....and do that before applying the constraint
You need to UPDATE your table to change all invalid dates to valid ones.
BTW. If there are dates before 01-01-1960 you will get an error committing this constraint.1970, be proverbial Goof, or is it mine again? Well , the goof is if you use Windows. It is one day off even in 1899.
What do you mean?BTW. If there are dates before 01-01-1960 you will get an error committing this constraint.1970, be proverbial Goof, or is it mine again?
What is this thing about 1970?1970-01-01 is the "Start"-Date of the Unix-Timestamp
An exception - this is, what I want.Well, that's what you will get when you set a constraint like we showed with CHECK and want to add a record which doesn't pass the check.
What is this thing about 1970?Just forget about this remark for now.