Link to home
Start Free TrialLog in
Avatar of saved4use
saved4useFlag for United States of America

asked on

DB2 Union All - blank date fields

I wrote an UNION ALL DB2 query statement and got the error msg below. How can I fix this?
**FYI, both statement run perfectly individually, but throw errors when I do UNION ALL.
Thanks.

"DB2 Database Error: ERROR [22007] [IBM][DB2/AIX64] SQL0180N  The syntax of the string representation of a datetime value is incorrect.  SQLSTATE=22007"
      

select
b.clrg_cor_num
,r.beta_rep_cd
,ar.beta_acct_num
,ar.lookup_1_txt
,t.cmpl_rstr_ind
,t.CMPL_RSTR_ADD_DT
,t.inac_36mo_ind
,t.INAC_36MO_ADD_DT
,''
,df.asset_amt as AUM


FROM DW.ACCT_REF AR

UNION ALL

select
b.clrg_cor_num
,r.beta_rep_cd
,ar.beta_acct_num
,ar.lookup_1_txt
,''
,''
,''
,''
,ar.DOC_RSTRCT_IND
,df.asset_amt as AUM


FROM DW.ACCT_REF AR
SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial