Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Time 1

Status
Not open for further replies.

caper1175

MIS
Sep 23, 2003
42
US
Hi All: I am creating a report based on a table. In this table the time is stored like 1116 where this should be equal to 11:16 AM and 2316 should be 11:16 PM. How can I format these values to appear correctly? I want to display the time as 11:16 PM instead of 2316 (without the colon).
 
Try using this:

Code:
Format(TimeSerial(Mid$([fieldname],1,2), Mid$([fieldname],3,2), 0), "hh:mm AMPM")

I think this should parse out your text field and convert it to a time value in the appropriate format.

Post back if you have any questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
caper: Glad that worked for you.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top