I am hopeful that someone can help with this code I am trying to execute. The 3754 error prevents me from getting records for some reason that I cannot grasp. Here is the code:
'4' AS RPT_ID
,'NOT STARTED' AS REPORT_TYPE
, A.WARNINGS_ID AS INCDNT_ID
, E.TAXONOMY_DESC AS CAT
, (CURRENT_DATE - CAST(B.ACTN_TSTMP AS DATE)) AS DAYS_OUT
WHEN (CURRENT_DATE - CAST(B.ACTN_TSTMP AS DATE)) <= 30 THEN '1. 0 - 30 DAYS'
WHEN (CURRENT_DATE - CAST(B.ACTN_TSTMP AS DATE)) <= 60 THEN '2. 31 - 60 DAYS'
WHEN (CURRENT_DATE - CAST(B.ACTN_TSTMP AS DATE)) <= 90 THEN '3. 61 - 90 DAYS'
'4. 90 + DAYS'
END AS AGE
, A.REASON AS RSK_REAS
, A.ASSGNMT AS INCDNT_REC_TYP
, F.STATUS_NAME AS STS_DESC_EN
, D.AGENT_NM AS USR_FN
, D.AGENT_NM AS USR_LN
, A.ALERT AS TEAM_ID /* THIS IS A SUBSTITUTION FOR MGR_LAN_ID*/
/*, CMPLX - CONTINGENT UPON CHANGE REQUEST */
, CURRENT_DATE AS REPORT_DATE
B.ENTY_KEY = A.ALERT_ID
C.ENTY_KEY = B.ENTY_KEY
D.USRID = C.USRID
B.WKPRC_STS_ID = F.WKPRC_STS_ID
B.WKPRC_STS_ID IN ('1004','1007','1009')
Thanks in advance for your help.
If you try to compare a character field with a numeric field, the Teradata default is to implicitly convert both to FLOAT. Look at the DDL (e.g. do SHOW for the above statement) and figure out where this is occurring. Then do explicit CAST to a compatible datatype of higher numeric precision (perhaps BIGINT or DECIMAL(38)).
Thanks for the help Fred. It looks like the join with enty_key to alert_id has a varchar to decimal relationship. I just performed a cast to make the join equal. So were right on the money with your answer!