Forum Discussion

ColeenSchmitt1's avatar
ColeenSchmitt1
Qrew Cadet
7 years ago

Converting Month & Year (Text) to Date Field

Hi,

I have a text field [Invoice Month] (reads "January 2019", "February 2019", etc) that I need to reformat into a date format. (January 2019 to 01/01/2019). What is the best way to do this?

Thanks! 
  • This should work as a formula date field

    var number YYYY = ToNumber(Trim(Right([Invoice Date], " ")));

    var text MonthName = Trim(Left([Invoice Date], " "));

    var number MM = Case($MonthName,
    "January", 1,
    "February", 2,
    "etc", 99,
    "December", 12);

    Date($YYYY,$MM,1)