Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Re: Convert from integer to date

$
0
0

Hi Víctor Machuca,

 

I observed Data Services that when we using the integer as a dataype for a filed. It will truncates the preceding zero's.

 

so let us use have a source as.

 

 

When we run a job the output is

 

 

for the month and day we need to pad the '0' by using the lpad function.


 

to_date( Query.Year||lpad(Query.Month,2,'0')||lpad(Query.Day ,2,'0'), 'YYYYMMDD')


Output :

 



Regards,

Akhilesh Kiran.



Viewing all articles
Browse latest Browse all 2695

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>