RE: DATES MANAGEMENT ON C-ISAM 5.00
Posted in 1999
Topics: General Discussion
Couldn't be arsed to work out you email address with all that spam business
in it.
You've not stated what is actually wrong with getting back 10/11/1900.
Assuming that you expected it to return 11/11/2000 then I think your problem
is
that the DBCENTURY environment variable is not set.
Try setting it to 'C'
(Anything wrong with that answer Obby ?? :-> )
-----Original Message-----
From: MC [mailto:massimo.corradiNOmaSPAM@iconeurope.com.invalid]
Sent: 19 November 1999 11:12
To: informix-list@iiug.org
Subject: DATES MANAGEMENT ON C-ISAM 5.00
We have an Informix database.
The version is: C-ISAM 5.00.UC1
The SQL interface version is: 7.20.UD1
THIS IS THE ".profile" for user INFORMIX
************************************************************
**********************
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/informix
/data/informix.upg/bin:.
TERMCAP=/usr/informix/etc/termcap
TERM=wyse60
INFORMIXSERVER=icon_db
INFORMIXDIR=/usr/informix/data/informix.upg
DBDATE=dmy4/DBTEMP=/usr/informix/data/tmp
export PATH TERM TERMCAP INFORMIXSERVER DBDATE DBTEMPINFORMIXDIR
************************************************************
**********************
Our problem is:
if I run the following query (where podet is a dummy table):
select date("10/11/99") from podet
I have: 10/11/1999
but if I run:
select date("10/11/00") from podet
I have: 10/11/1900
Is there any help you can give me?
Thank you
I'm agree with Rekaish just set the environment variable DBCENTURY to C.
C is for Closest.
Some explanations
P = Past The past and present centuries are used to expand the year
value. These two dates are compared against the current date,
and the date that is prior to the current date is chosen. If both
dates are prior to the current date, the date that is closest to
the current date is chosen.
F = Future The present and the next centuries are used to expand the
year value. These two dates are compared against the current
date, and the date that is after the current date is chosen. If
both the expansions are after the current date, the date that is
closest to the current date is chosen.
C = Closest The past, present, and next centuries are used to expand the
year value, and the date that is closest to the current date is
used.
R = Present The present century is used to expand the year value.
For instance : Behavior of DBCENTURY = C
Example data type: DATE
Current date: 4/6/1998
User enters: 1-1-1
DBCENTURY = C, Closest century algorithm
Previous century expansion : 1/1/1801
Present century expansion: 1/1/1901
Next century expansion: 1/1/2001
Analysis: Because the next century expansion is the closest to the current
date,
1/1/2001 is chosen.
Regards
Rekaish Bhardwaj a 'crit dans le message <813ija$4ce$1@news.xmission.com>...
>
>Couldn't be arsed to work out you email address with all that spam business
>in it.
>You've not stated what is actually wrong with getting back 10/11/1900.
>Assuming that you expected it to return 11/11/2000 then I think your
problem
>is
>that the DBCENTURY environment variable is not set.
>
>Try setting it to 'C'
>
>(Anything wrong with that answer Obby ?? :-> )
>
>-----Original Message-----
>From: MC [mailto:massimo.corradiNOmaSPAM@iconeurope.com.invalid]
>Sent: 19 November 1999 11:12
>To: informix-list@iiug.org
>Subject: DATES MANAGEMENT ON C-ISAM 5.00
>
>
>We have an Informix database.
>The version is: C-ISAM 5.00.UC1
>The SQL interface version is: 7.20.UD1
>
>THIS IS THE ".profile" for user INFORMIX
>************************************************************
>**********************
>PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11>:/sbin:/usr/informix
>/data/informix.upg/bin:.
>TERMCAP=/usr/informix/etc/termcap
>TERM=wyse60
>INFORMIXSERVER=icon_db
>INFORMIXDIR=/usr/informix/data/informix.upg
>DBDATE=dmy4/>DBTEMP=/usr/informix/data/tmp
>
>export PATH TERM TERMCAP INFORMIXSERVER DBDATE DBTEMP>INFORMIXDIR
>************************************************************
>**********************
>
>Our problem is:
>
>if I run the following query (where podet is a dummy table):
>
>select date("10/11/99") from podet
>I have: 10/11/1999
>
>but if I run:
>
>select date("10/11/00") from podet
>I have: 10/11/1900
>
>Is there any help you can give me?
>Thank you
>
Thank you but I don't think DBCENTURY is supported under C-ISAM 5.00 * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
I'm here again with questions on dates!! Now I've solved the problem with DBCENTURY (='C') and it works! I have another problem with the fact that 2000 is a bissextile year. infact if I run: select date("29/02/00") from podet --> 1204: Invalid year in date select date("28/02/00") from podet --> 28/02/2000 * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
Sounds like you need to upgrade. Using DBCENTURY will allow the conversion, but some versions of both the engine and the compiler have a bug that won't distinguish 2000 as a leap year. Subject: Re: DATES MANAGEMENT ON C-ISAM 5.00 From: MC <massimo.corradiNOmaSPAM@iconeurope.com.invalid> Date: Fri, 19 Nov 1999 07:43:00 -0800 I'm here again with questions on dates!! Now I've solved the problem with DBCENTURY (='C') and it works! I have another problem with the fact that 2000 is a bissextile year. infact if I run: select date("29/02/00") from podet --> 1204: Invalid year in date select date("28/02/00") from podet --> 28/02/2000