Concatenate Times

D

Dawn

=IIf([EndTime]>[StartTime],(Format([StartTime],"Medium
Time")) & " to " & (Format([EndTime],"Medium Time")),
(Format([StartTime],"Medium Time")))

How can I get this to work and also remove the leading 0
from time if hour of time is 1:00 p.m. to 9:00 p.m.(so it
isn't display for instance like 01:00 p.m. to 09:00 p.m.)

Thanks!
 
K

kip

-----Original Message-----
=IIf([EndTime]>[StartTime],(Format([StartTime],"Medium
Time")) & " to " & (Format([EndTime],"Medium Time")),
(Format([StartTime],"Medium Time")))

How can I get this to work and also remove the leading 0
from time if hour of time is 1:00 p.m. to 9:00 p.m.(so it
isn't display for instance like 01:00 p.m. to 09:00 p.m.)

Thanks!
.
I pasted your code into a txt field. It didn't work so I
looked at the formula and it had weird characters in the
string "Medium Time": looked more like "me""\d""ium
T\\d" or something weird like that. Changed it
to "Medium time" and it worked as expected.
 
G

Guest

Thanks Kip for your reply. Still does not work. I still
get the leading 0.
-----Original Message-----
-----Original Message-----
=IIf([EndTime]>[StartTime],(Format([StartTime],"Medium
Time")) & " to " & (Format([EndTime],"Medium Time")),
(Format([StartTime],"Medium Time")))

How can I get this to work and also remove the leading 0
from time if hour of time is 1:00 p.m. to 9:00 p.m.(so it
isn't display for instance like 01:00 p.m. to 09:00 p.m.)

Thanks!
.
I pasted your code into a txt field. It didn't work so I
looked at the formula and it had weird characters in the
string "Medium Time": looked more like "me""\d""ium
T\\d" or something weird like that. Changed it
to "Medium time" and it worked as expected.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top