Very Urgent

Tools & Utilities

Very Urgent

Iam Selecting Date format of 'yyyy-mm-dd' and trying to insert that in another table using join conditions. It is giving INVALID DATE and unable to insert that. Query have only join and the formats of DATE is same in both Source and Target Tables. But even then y it is giving that Error? Pls can any one help in this.

The following is the query:

INSERT INTO STG_TSAVFINANCIAL
(TIMEKEY
, PRODTYPE
, ACCTNO
, PRODCD
, LEDGERBAL
, ACCRUINTASAT
, YEARINTCR
, ACCRUINT
, ACCRUINT4D
, HHLDAMT
, HALFDAYHLDAMT
, ONEDAYHLDAMT
, TWODAYHLDAMT)

SELECT
DABH.DBS_Agreement_Hist_Start_Dt as TIMEKEY
, SUBSTR(A.ACCOUNT_MODIFIER_NUM,6) as PRODTYPE
, A.Account_Num as ACCTNO
, A.Product_Id as PRODCD
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'LB' THEN DABH.DBS_Agreement_Hist_Amt END) as LEDGERBAL
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'IM' THEN DABH.DBS_Agreement_Hist_Amt END) as ACCRUINTASAT
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'IL' THEN DABH.DBS_Agreement_Hist_Amt END) as YEARINTCR
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'At' THEN DABH.DBS_Agreement_Hist_Amt END) as ACCRUINT
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'AI' THEN DABH.DBS_Agreement_Hist_Amt END) as ACCRUINT4D
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'HH' THEN DABH.DBS_Agreement_Hist_Amt END) as HHLDAMT
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'Hd' THEN DABH.DBS_Agreement_Hist_Amt END) as HALFDAYHLDAMT
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'Odm' THEN DABH.DBS_Agreement_Hist_Amt END) as ONEDAYHLDAMT
, (CASE WHEN DABH.DBS_Agreement_Summary_Type_Cd = 'Tdm' THEN DABH.DBS_Agreement_Hist_Amt END) as TWODAYHLDAMT

FROM
v_AGREEMENT A
INNER JOIN V_DBS_AGREEMENT_BALANCE_HIST DABH
ON (A.ACCOUNT_NUM = DABH.ACCOUNT_NUM
AND A.ACCOUNT_MODFIER_NUM = DABH.ACCOUNT_MODIFIER_NUM)

WHERE
DABH.DBS_Agreement_Summary_Type_Cd IN ('LB','IM','IL','At','AI','HH','Hd','Odm','Tdm')