Skip to main content

Convert Numeric Value to Date Format



                                                                                                                                                                      
Scenario:
Suppose you are importing a flat file emp.csv and hire_date colummn is in numeric format, like 20101111 .Our objective is convert it to date,with a format 'YYYYMMDD'.
 
Source
  EMPNO       HIRE_DATE(numeric)         
  -------            -----------
     1                20101111
     2                20090909
Target
EMPNO            HIRE_DATE (date)        
 ------                   -----------
     1                   11/11/2010
     2                    09/09/2009


Solution:

  1. Connect SQF to an expression.
  2. In expression make hire_date as input only and make another port hire_date1 as o/p port with date data type.
  3. In o/p port of hire_date write condition like as below
          TO_DATE(TO_CHAR(hire_date),’YYYYMMDD’)


Comments

  1. I enjoyed your post. It’s a lot like college – we should absorb everything we can but ultimately you need to take what you’ve learned and apply it.Nice man. Extremely informative post. I'll be sure to pass this along to my friends.
    Suzuki Esteem AC Compressor

    ReplyDelete
  2. The data warehouse interview questions are all related and here in this particular website user can get the chance to learn more about interview questionnaires as well as topics. The blog here covers all important topics related to the interview question and other necessary areas. The questionnaires are all prepared and tabulated by professional informatica interview questions and answers for experienced.

    ReplyDelete

Post a Comment