Converting Month & Year (Text) to Date Field

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
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! 
Photo of Coleen Schmitt

Coleen Schmitt

  • 382 Points 250 badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,096 Points 50k badge 2x thumb
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)




Photo of Coleen Schmitt

Coleen Schmitt

  • 382 Points 250 badge 2x thumb
Thank you! This worked perfectly!