Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

How to convert number to date?

So I have a column that I import to my dataset that comes in as "201701" or "201702" etc. I am trying to turn this column into the end of month date for the respective month. So 1/31/17 for the first and 2/28/17 for the second. I know I can split the column by number of characters to get a column with "2017" and another column  with "01" or "02". However, I'm stumped where to go from here to make these columns the date I want. I don't think I can use any date functions since these columns are recognized as numbers. And if I convert the columns to date, it just makes them a weird date.

 

Any ideas or is it possible to convert this column into a column that I'm looking for?

 

Thanks

  • Could you not try making a column using EOMONTH(DATE([theyearcolumnyoumade],[themonthcolumnyoumade],1))?

2 Replies

  • jthomson's avatar
    jthomson
    Icon for Solution Sage rankSolution Sage

    Could you not try making a column using EOMONTH(DATE([theyearcolumnyoumade],[themonthcolumnyoumade],1))?

    • Anonymous's avatar
      Anonymous
      Not applicable

      That did the trick. Thanks! Didn't think the date functions would work.