I have a time field (Time OnCPBP) in which I can set a script to
enter the current time; however when I want to enter the military
time manually, I use the Auto-Enter Calculated value specified as:
Let ( [ TheText=GetAsText(Time OnCPBP);
Reformat=(PatternCount(TheText;":")=0);
RawNumber=GetAsNumber(TheText) ];
Case(Reformat; Time(Div(RawNumber;100);
Mod(RawNumber;100) ;0);
Time OnCPBP))
This lets me enter the four digits and it inserts the semi-colon for
me (much easier) for my users....
Problem:
I have another time field (On CPBP #2) in which the calculated value
is specified as:
If (Event = "On CPBP #2"; Time), so whenever the "Event" field is "On
CPBP #2) the time gets entered automatically. The caveat is, I would
also like to enter the 4-digit method manually and format as above
but I'm having trouble combining the two calculations.
Any thoughts, not sure why this stumped me.
I thought something like:
If (Event = "On CPBP #2"; Time) +
Let ( [ TheText=GetAsText(Time OnCPBP #2);
Reformat=(PatternCount(TheText;":")=0);
RawNumber=GetAsNumber(TheText) ];
Case(Reformat; Time(Div(RawNumber;100);
Mod(RawNumber;100) ;0);
Time OnCPBP #2))
I guess my basic problem is how to "nest" these two formula together. Each works separately but I need them both in this field. Thanks to anyone!