Hi,
I have this formula:
DateTimeTrim(DatetimeAdd([Create Date],1,"month"),"day")
I'm adding 1 month to the date in [Create Date] << a home made field, and would like the "00:00:00" removed. I thought the DateTimeTrim() would do that with the parameter "day", but it's not removing the zeros.
Thanks in advance,
Chris
¡Resuelto! Ir a solución.
The DateTimeTrim function will basically round the datetime down to the unit you want. i.e. day trims time to 00:00:00 regardless of what it was previously. I recommend either using datetimeformat to just format out the time or a regex_replace function call of " .*", "" assuming your date is not separated by spaces.
The Formula tool can't change the data type of an existing field. But, you can create a new field with a data type of Date, and then the time piece should fall away.
Let me know if that helps.
Cheers,
Esther
Hi @Archaeoptryx,
Try using this formula.
Thanks.
Hi EstherB47,
Thanks. I did not think about the data type feature to place on the date, and that helped. Thank you.
Hi grazitti_sapna
My result is null when I use this formula. Let me break down my components.
The formula is named [Create Date plus a month].
DateTimeFormat(DatetimeAdd([Create Date],1,"month"),"%B %d, %Y"), its type is Date. I'm using the format "%B %d%Y".
The formula [Create Date] consists of these functions: ToDate(DateTimeStart()), its type is Date.
My output renders "null" .
Hey everyone,
I got this working now. I appreciate all your input. I have to focus on keeping the data types straight. I want to use a format of "July 4, 2019" So, that's a V_String, not a date. duh!
Thanks again,
Chris
Thanks!
This was ideal, sorted it immediately