[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Year 2000 dates



We are using SQR with an Oracle database.

Some reports we have require the input of first/last dates as selection
criteria. We have just hit the problem whilst doing some long range
planning of the first/last dates crossing the year 2000.  Eg where
clause has date > 01-JAN-1998 and date < 01-JAN-2002.

We get these dates into the report using the INPUT statement. We want
to ensure valid dates are entered, so we use

INPUT $date TYPE=DATE

However, with the Oracle version of SQR, this does a type check against
the DD-MON-YY format, so our four digit year is not accepted.

We can run the report by inputting the date as TYPE=CHAR with no date
format check, and using

begin-sql
alter session set NLS_DATE_FORMAT='DD-MON-YYYY'
end-sql

to make sure that oracle accepts the four digit year in where clauses,
but this will not stop people entering an invalid date as a report
input (eg 21/12/2001 rather than 21-DEC-2001)

Does anyone know of an easy way to check the format of a date that has
been input with a 4 digit year????