Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Engine Error: 22007

Status
Not open for further replies.

Vuke

MIS
Jan 3, 2003
6
US
I'm using a ODBC lotus notes database, and I'm recieving an error that says Data value is not a valid date, time or timestamp. Obviously I'm using a date field. I am new to Crystal and I can't figure this out.
 
Dear Vuke,

In looking up that error with ODBC all the info I found indicates that this is an error thrown by ODBC when bad or corrupted data exists in a date field.

The following information may be helpful - note the condition that requires that Error 22007 to be returned by odbc in item 3 below .

The required ISO 8601 syntax for DATE is:

DATE `YYYY-MM-DD`

Comments:

1) DATE combines the datetime fields YEAR, MONTH and DAY.

2) DATE defines a set of correctly formed values that
represent any valid Gregorian calendar date between January 1, 1
AD and December 31, 9999 AD.

3) Any operation that attempts to make a DATE <data type>
contain a YEAR value that is less than 1 or greater than 9999
will fail; the DBMS will return the:
SQLSTATE error 22007 &quot;data exception-invalid datetime format&quot;.

4) DATE expects dates to have the following form: yyyy-mm-dd
e.g.: 1994-07-15 represents July 15, 1994.
5) DATE has a length of 10.
6) Date literals must start with the <keyword> DATE and
include `yyyy-mm-dd`;
e.g.:

CREATE mytable (mydate DATE);
INSERT INTO mytable (mydate) VALUES (DATE `1996-01-01`);

I suggest that you examine your database with whatever database tool you use.

Hope that helps,

ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Thank you for the response...I'm checking the fields now.

Vuke
 
hey Ro,

One more question...How did you go about looking up the specific error message?

Vuke
 
Hey,

After checking Crystal's site and not finding anything I googled it!

22007 +odbc

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top