I keep getting the following Oracle message: " [ORACE][ODBC][Ora]ORA-00933: SQL command not properly ended" when I run this query below
SELECT to_char(app_n) as app_num, ASGN_CR_LIM_A as climit, FNAL_DISP_D as decision_dt, ENTY_D as application_dt, to_char (FNAL_DISP_D, ‘yyyy-mm’) as decdt_yyyy_mm, FNAL_DISP_D-ENTY_D as days_to_decision,
case when STAT_C=‘NEWACCOUNT’ then ‘APPROVED’
WHEN STAT_C=‘DECLINE’ THEN ‘Decline’
end as app_decision, APPCT_FICO_SCOR_N as applicant_fico, CO_APPCT_FICO_SCOR_N as co_application_fico, ICOME_A as income, DBT_A, HIGH_LIM_A as High_Limit, RECM_LINE_A, CELL_C, case when CELL_C in (‘cell 10’ , ‘’) then ‘AUTO’
else ‘MANUAL’
end as decision, substr(UBS_CARD_I, 13,4) as UBS_card_I
FROM BANK_OWNER.CCU_APPLICATION_INFO where STAT_C in (‘NEWACCOUNT’ , ‘DECLINE’) and curr_rec_f=‘Y’
and app_n not in (14005325, 14007232, 14007045) and (substr(to_char(ubs_carD_i), 1,6) is null or substR(to_char(ubs_card_i), 1, 6) in (‘419742’))
and FNAL_DISP_D between ‘01-JUNE-2017’ and ‘30-JUNE-2017’
SELECT CCU_CUSTOMER_INFO.CLI_DOB_D
FROM CCU_CUSTOMER_INFO
INNER JOIN CCU_APPLICATION_INFO
ON CCU_APPLICATION_INFO.DATE_OF_BIRTH_NL = CCU_APPLICATION_INFO.DATE_OF_BIRTH_NL
What am I doing wrong?