ali said:
I have a table with time in this format "12:00:00 AM".
I 'd like to extract the time in these two formats
1) 12:00 (12-hour)
2) 12:00 (24-hour)
Tables don't store formatted values. They just have default format properties
that dictate how they will show them on the screen. Just use a different format
property wherever you are displaying them.
I don't think you can display a 12 hour format without having am/pm unless you
use the format function to produce a text string from your value and then strip
the am/pm off of that (as below). Of course that means what you have left is
now an actual string. It will not sort like a DateTime nor can you easily
perform DateTime functions on it.
=Left(Format([yourField], "hh:nn ampm"),4)