SELECT * FROM HACPRP.EQ_POOL_ACT_VIEW WHERE ACTVTY_DT IN ( SELECT ACTVTY_DT FROM HACPRP.EQ_POOL_ACT_VIEW WHERE SUBSTR(ACTVTY_DT,5,2) < '03' UNION SELECT ACTVTY_DT FROM HACPRP.EQ_POOL_ACT_VIEW WHERE SUBSTR(ACTVTY_DT,1,2) < '09' AND SUBSTR(ACTVTY_DT,5,2) = '03' UNION SELECT ACTVTY_DT FROM HACPRP.EQ_POOL_ACT_VIEW WHERE SUBSTR(ACTVTY_DT,3,2) < '29' AND SUBSTR(ACTVTY_DT,1,2) = '09' AND SUBSTR(ACTVTY_DT,5,2)= '03' );
The reason I have to do it like this is that someone created the table with ACTVTY_DT as CHAR(06) instead of DATE....
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Why does the above SQL not run? It states that it is not suitable for the DB2 Manager. My aim is to simply select a list of entries that are less than the date given on the JCL job.
Dig Deeper on Oracle and SQL
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.