Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATA CONVERSION FUNCTION ERROR 1

Status
Not open for further replies.

Ann28

MIS
Apr 2, 2004
97
US
The date is defined as CHAR (20041231)

Code:
select MEMBER_SSN  ,  date (  LEFT ( END_DATE,4) || '-' ||  SUBSTR(END_DATE, 5,2)  || '-'  ||  RIGHT (END_DATE,2 )   )
END_DATE, BENEFIT_PLAN from elg_summary  fetch first 10 rows only

& the error...[red]SQL0440N No authorized routine named "DATE" of type "FUNCTION having
compatible arguments was found. [/red]


Really appreciate your help!!!
Thanks,
Ann [morning]
 
Ann,

I don't know why your sql doesn't work, but I was able to get your sql to work by replacing the left and right functions with substr.

Code:
select MEMBER_SSN  ,  date (  SUBSTR ( END_DATE,1,4) || '-' ||  SUBSTR(END_DATE, 5,2)  || '-'  ||  SUBSTR (END_DATE,7,2 )   )
END_DATE, BENEFIT_PLAN from elg_summary  fetch first 10 rows only
 
Ann,

Another way to make it work is to use the char function.
Code:
select MEMBER_SSN  ,  date (  char( LEFT ( END_DATE,4) || '-' ||  SUBSTR(END_DATE, 5,2)  || '-'  ||  RIGHT (END_DATE,2 ) ) )
END_DATE, BENEFIT_PLAN from elg_summary  fetch first 10 rows only
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top