Forum Discussion

i_stanescu_ro's avatar
2 years ago
Solved

Change number into date

Hi guys

 

I have a column with numbers with this format:

 

19990927

 

I need to change it to a date format, like this: 09.27.1999 or 27.09.1999 or something like this..

 

Can I pls ask for your help?

 

 

Thanks so much for your time!

  • i_stanescu_ro ,

    try this in calculated column,

    New Date (Calculated Column) = 
    VAR _year = LEFT(Test[Date],4)
    VAR _month = MID(Test[Date],5,2)
    VAR _day = RIGHT(Test[Date],2)
    VAR _date = DATE(_year,_month,_day)
    RETURN _date

4 Replies

  • i_stanescu_ro 

    Create a calculated column, suppose your data is in a column called  TextData

    var __Date = TABLENAME[TEXTDATA]
    
    return
    
    	DATE( INT(LEFT(__Date,4)) ,  INT(MID(__Date,5,2)) ,  INT(RIGHT(__Date,2)) )
  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    i_stanescu_ro ,

    try this in calculated column,

    New Date (Calculated Column) = 
    VAR _year = LEFT(Test[Date],4)
    VAR _month = MID(Test[Date],5,2)
    VAR _day = RIGHT(Test[Date],2)
    VAR _date = DATE(_year,_month,_day)
    RETURN _date