[comp.databases] Informix 4gl construct and DBDATE

jw@pan.UUCP (Jamie Watson) (08/07/88)

It appears to me that the "construct" statement in Informix 4gl doesn't
work correctly when DBDATE is set to "DMY4.", which is the format we
use here in Switzerland.  The symptom is that when using a construct
statement, valid dates, for which we know there is matching data in the
database, don't match.  However, if we invert the sequence of the day
and month when we give the input to the construct statement, it matches.

A small example.  We have a field called datum.  We create a record,
with input like this:

    Datum: 1.6.88

We then execute a construct statement on this field, with input like this:

    Datum: 1.6.88

The ensuing select statement fails to match the record we just created.
We execute the construct again, this time giving input like this:

    Datum: 6.1.88

The select statement matches the record this time!

I addes a statement to display the contents of the constructed variable
before executing the select, and found that reversed the day and month
on the input date; that is, in the first case above the constructed
variable contained the string 'datum="6.1.88"', and in the second case
it contained '"datum="1.6.88"'.  This makes it obvious why it has such
a problem matching, doesn't it?

Apparently what is happening is that the construct statement is seeing
the DBDATE format, and rearranging the month and year to "standard"
order, then the select statement is seeing DBDATE, and rearranging
things again; the double change is the problem.

Has anyone else seen this problem?  If so, have you found a workaround?

jw