× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



How does System i Access handle null dates? Should you be using those
instead?

System i Access does have a sql screen you can modify. I just ran one
with this in the select box
case mydate when '0001-01-01' then '1970-01-01' else mydate end
I ended up receiving
"06/20/09"
"01/01/70"
from these file values
CREATE TABLE ROB/DELETEME (MYDATE DATE NOT NULL WITH DEFAULT)
Table DELETEME created in ROB.
INSERT INTO ROB/DELETEME VALUES('2009-06-20')
1 rows inserted in DELETEME in ROB.
INSERT INTO ROB/DELETEME VALUES('0001-01-01')

What was your target file? I did CSV.

If I don't use the CASE statement I get

CWBDB0099 - No more data is available for the stream fetch request

SQL0181 - Value in date, time, or timestamp string not valid.

Cause . . . . . : The string representation of a date, time or timestamp
value is not in the acceptable range. *N is either the character string
constant that is not valid or the column or host variable that contained
the string. If the name is *N, then the value was found in an expression
specified in the statement. If the value was found in a host variable,
then the host variable number is 0. The proper ranges for date, time, or
timestamp values are as follows: -- The range for years is from 0001 to
9999. -- The range for months is from 1 to 12. -- The range for days is
from 1 - 30 for April, June, September, and November, from 1 - 28 for
February and from 1 to 31 for all other months. In a leap year, the range
for February can be from 1 to 29. -- The range for days in a Julian date
is from 001 to 366 for a leap year or 001 to 365 days for all other years.
-- The range for hours is from 0 to 24. If the hour is 24, then the other
parts of the time values must be zeros. If the time format is USA, then
the hour cannot be greater than 12. -- The range for minutes is from 0 to
59. -- The range for seconds is from 0 to 59. -- The range for
microseconds is from 0 to 999999. Recovery . . . : Ensure that the
date, time, or timestamp value conforms to the ranges for the data type it
represents. Try the request again.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.