SOLVED

updating time field with choice of two times

Copper Contributor

Hi is it possible to add an auto updating time field in a word document that updates to show one of two specific times depending on the time the document is being written? EG to create a show report for a stage play about the specific show times? 

If I am writing the show report at 5 pm for example, about the 2 pm show, it would auto update to show 2 pm, but if I was writing the report at 11 pm for the 730 pm show, it would show the time as 730 pm.

4 Replies
best response confirmed by bootest (Copper Contributor)
Solution

The following field construction will show 7:30 pm if the present time is later that 7 pm, otherwise, it will show 2 pm

{ IF { DATE \@ hh } > 19 "7:30 pm" "2 pm" }

You must use CTRL+F9 to insert each pair of field delimiters { } and ALT+F9 to toggle off their display and F9 to update the result.

Thanks mate, that worked a charm!
While we're on the subject is there a way to do the same thing with a set of time frames? Eg before 7 pm have it display 0900 -1700 and after seven display 1700 - 2300?
Never mind, I rubbed my brain cells together and figured it out myself. Thanks again!
1 best response

Accepted Solutions
best response confirmed by bootest (Copper Contributor)
Solution

The following field construction will show 7:30 pm if the present time is later that 7 pm, otherwise, it will show 2 pm

{ IF { DATE \@ hh } > 19 "7:30 pm" "2 pm" }

You must use CTRL+F9 to insert each pair of field delimiters { } and ALT+F9 to toggle off their display and F9 to update the result.

View solution in original post