Expresions

JSO
Silver 2
Silver 2

I want to create a pdf from a bot.
Can someone give me an explanation so that when the content of myDayTime of type DateTime is 10/05/2023 00:00 and I want to eliminate the hour and minutes the formulas:


1 - DOES NOT WORK
<< SUBSTITUTE(TEXT([myDayTime], ”DD/MM/YYYY HH:HH”), ”00:00”, “--.--”) >>


2 - THIS IS IF IT WORKS
<<TEXT([myDayTime],”DD/MM/YYYY”) >> << IF( HOUR(TIME([myDayTime])-”00:00:00”)=0, ” “, TEXT([myDayTime] "H:MM")) >>

0 3 79
3 REPLIES 3

Why don't you use just DATE([myDayTime])

Because sometimes time is important. It is a Transportation application and an attempt is made to enter both the day and the time of loading in that data.
There are times when instead of a fixed time it is a period, or before...
In that case, the user leaves 00:00 as the time (it is an agreement) and I do not want it to appear to avoid inconsistencies.
Actually my surprise is because SUBSTITUTE() does not work when it is supposed to be working on a string.

I assume you are looking for something like..

IF(OR(HOUR([myDayTime]-"00:00:00")>0,MINUTE([myDayTime]-"00:00:00")>0),TEXT([myDayTime],"dd/mm/yyyy hh:mm"),TEXT([myDayTime],"dd/mm/yyyy"))

Top Labels in this Space