Is it possible to have a Beast Mode result in a Date Formatted field type?

This is the beast mode formula, but it doesn't provide a field which can be used in the Date Range Field

DATE_FORMAT(case when (`GREG_D` >= '2017-10-29' and `GREG_D`<= '2017-11-04') then '2017-11-04'
when (`GREG_D` >= '2017-11-05' and `GREG_D`<= '2017-11-11') then '2017-11-11'
when (`GREG_D` >= '2017-11-12' and `GREG_D`<= '2017-11-18') then '2017-11-18'
when (`GREG_D` >= '2017-11-19' and `GREG_D`<= '2017-11-25') then '2017-11-25'
else ' ' end,'%m/%d/%yy')

 

Thanks for any ideas!

Comments

  • Hi, I believe Domo does not recognize a string like '2017-11-05' as a date, but as text.

    You probably need to use STR_TO_DATE() around it - you can find the function here (scroll down a little). This way you could just exchange the DATE_FORMAT() part for STR_TO_DATE() with very little reformatting involved.

     

    This List of Date Format specifiers could also be useful in the future.

  • Thank you for this info! This will work great.