Very Urgent
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Very Urgent Expand / Collapse
Author
Message
Posted 2/14/2006 9:17:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/15/2006 4:45:00 AM
Posts: 4, Visits: 1
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')


Post #3530
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 ( 1 guest, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 3:44am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.016. 7 queries. Compression Disabled.