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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert datetime field to 24 hour time not using custom format 1

Status
Not open for further replies.

kranmar

Technical User
Mar 22, 2007
8
US
I have a datetime field that although I can set the custom datetime format to 24 hours I need to create a formula to show the datetime as a 24 hour value instead of using the custom format option. For example in sql server the data returns mm/dd/yyyy hh:mm:ss am or pm. I need help creating a formula so this datetime field returns 07/31/2007 22:55 NOT 07/31/2007 10:55 PM.
 
Hi kranmar

Can I ask why you do not prefer the Custom Format option?

Cheers
paulmarr
 
Thank you for replying.
I need to setup a formula to be used on a barcode and the end-user needs it to show in a 24 hour format. If this was a char field and not a datetime field I could parse it out in a formula. If I use the custom format the barcode will return it in a 12 hour format.
kranmar
 
Try this formula:
ToText({YourDateTimeField},"DD/mm/yyyy HH:mm")

Then convert this formula to bar code. Take notice of the use of upper case in the formatting arguments.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top