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

How to Insert AM or PM in a date returned from the database 1

Status
Not open for further replies.

longfellow

IS-IT--Management
Mar 28, 2002
75
IN
hi all
I have a date field returned from the database like the following:
totext(Minimum({Table.TIME}),"hh:mm on MMMM dd, yyyy")
I want AM or PM to be displayed as recorded in the DB . How do i do that. Because the above formula only gives the following output
04:00 on March 15, 1999
How do i get AM or PM as present in the DB

Thanking you

Longfellow
 
this is from crystals kabse ---

Knowledge Base
Article ID:
c2001735

Created:
1998/09/10

Reviewed :
2000/06/23






Contact Technical Support




Including AM/PM when using ToText function on date/time fields

The information in the article refers to:
Seagate Crystal Reports 6


Applies to:

Reported version and higher
Formulas
DateTime formula



Synopsis

When using the ToText function on a date-time field, and the AM/PM formatting string is to be included, you must specify this using the 'tt' key.

he 'tt' key specifies what form the AM/PM indicator is to take, as illustrated by the examples below.


Solution

Formula solution examples:

//With only the 'tt' format string:
ToText(DateTime(1998, 03, 05, 13, 24, 30), "yyyy, MMM, dd HH:mm:ss tt")
will return: "1998, Mar, 05 13:24:30 PM" (The default value for tt.)

//With am/pm format strings
ToText({date-timefield}, "yyyy, MMM, dd HH:mm:ss tt", "MORN", "EVE")
will return "1998, Mar, 05 13:24:30 EVE"

//With one character format strings:
ToText({date-timefield}, "yyyy, MMM, dd HH:mm:ss t", MORN, EVE)
will return "1998, Mar, 05 13:24:30 E"

//If the placement of the format strings with 'tt' is not indicated:
ToText({date-timefield}, "yyyy, MMM, dd HH:mm:ss", MORN, EVE)
will return "1998, Mar, 05 13:24:30"

See also kbase c2001595 for similar formatting of time strings.

LMC cryerlisa@hotmail.com

select * from Management where proj_mgmt_skills <> NULL

0 records returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top