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!

SQL ERROR : Data types are not compatible

Status
Not open for further replies.

iren

Technical User
Mar 8, 2005
106
US
Hi!

I wrote a code in DB2 (running through SAS program) and I got the following Error log.

What is wrong? Could you please give me a hand?

Thank You!
Iren
********************************************************
521 AND mm.COV_EFF_DT <= 12/31/2004
522 AND mm.COV_TERM_DT > 1/01/2004
523 AND mm.COV_TERM_DT <= 12/31/2004
524 ) by HDMconnect;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/AIX64] SQL0401N The data types of the operands
for the operation "<=" are not compatible. SQLSTATE=42818
 
i think you need single quotes around dates...something like this...

AND mm.COV_EFF_DT <= '12/31/2004'

-DNG
 
If even COV_EFF_DT datatype is DATE rather than CHAR?
Then...I am not sure what is the mechanism...?
 
Knowing nothing about DB2 I still believe you'll need to quoute the date values. 12/31/2004 is a numeric expression (equals to 0 since all types involved are integers).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top