Guy Boswell
Registered User.
- Local time
- Today, 19:27
- Joined
- Jul 20, 2009
- Messages
- 26
I am writting a module that generates scripts for flood warning messages. The text, once produced, goes to another system outside Access for telephone distribution via voice synthesis. Someone else has done all that clever technical stuff. All I need to do is produce the script as a text file.
Each message includes the date and time it is recorded. I have a little bit of code that takes now() and rounds it up to the next five-minute interval. So for example a script produced at 10:27:16 will say, "This message was recorded at ten thirty a m ...". I want all times in twelve hour clock format.
My problem is midday and midnight. There is a chance (1:144!) that a message will appear to be issued at exactly midday or midnight. In which case I want the message to say, "This message was recorded at midday ...". 12:00, 12:00 am or 12:00 pm can all be rather ambiguous!
So what I want is a format that takes a date time input and outputs text with the time replaced by the word midday or midnight if appropriate. Is there a format built in to Access that will do that? Or do I need to write a function?
Grateful for any help. Thank you
Each message includes the date and time it is recorded. I have a little bit of code that takes now() and rounds it up to the next five-minute interval. So for example a script produced at 10:27:16 will say, "This message was recorded at ten thirty a m ...". I want all times in twelve hour clock format.
My problem is midday and midnight. There is a chance (1:144!) that a message will appear to be issued at exactly midday or midnight. In which case I want the message to say, "This message was recorded at midday ...". 12:00, 12:00 am or 12:00 pm can all be rather ambiguous!
So what I want is a format that takes a date time input and outputs text with the time replaced by the word midday or midnight if appropriate. Is there a format built in to Access that will do that? Or do I need to write a function?
Grateful for any help. Thank you