Concatenate Times

  • Thread starter Thread starter Dawn
  • Start date Start date
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!
 
-----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.
 
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.
.
 
Back
Top