Cast and format

UDA
Enthusiast

Re: Cast and format

Hi,

SELECT
CLI.A40_CLNT_LCL_ID, CLI.A4_CORP_NAME, CLI.CD_SAE, CLI.CD_RAE, CLI.MERC, CLI.COD_MDLL
, CLI.COD_MOTIVAZ, CLI.DT_RFRM,
cast(otranslate(NER.DT_FNE_VLD_RAT,'.','-') as date format 'yyyy-mm-dd') as Data_Scad_Rating
, cast(otranslate(NER.DT_INI_VLD_RAT,'.','-') as date format 'yyyy-mm-dd') as Data_Val_Rating
, CLI.DT_RFRM - Data_Val_Rating as Vetusta_Rat
, NER.DESCR_RAT
, NER.CLASSE_RAT
FROM
FEED_BMRC.CAPRI_CLIENT CLI, DXDWH_DB.DWH_FD FID, DXDWH_STG.NERATING NER;

Thanks & Regards,

Adharssh.

Re: Cast and format

*******urgent***************

Hello every one ...

I need a help 

I have two tables and there is common field between those two table that is 'DP_INSERT_DATE' and the format of the date is "YYYY-MM-DD.T.MM:SS:(time zone also)" 

I need to join the tables using DP_INSERT_DATE and get the information....

Can you please help in the query thanks alot.

You can mail me at vinit.tippu@gmail.com

******Urgent*********

Re: Cast and format

I have below decimal values, 

0012.15

12457.4578

12.445

any way to cast as varchar and return excatly the same values in one select statement?

Junior Contributor

Re: Cast and format

You can't have 0012.15 in a Decimal column, there are no leading zeros unless you apply a FORMAT.

Regarding the variable number of fractional digits the easiest way is this

TRIM(col (FORMAT 'FN9'))
N/A

Re: Cast and format

hi,

I want to diplay 011 as 'zero one one ' in teradata. can you help me out !!

eg: 011- i need to display as 'zero one one'

012- i need to display as 'zero one two' like that way

Regards,

Vijaykumar