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

Format time field

Status
Not open for further replies.

hanglam

Programmer
Dec 11, 2002
143
US
Hi,

I'm using VB.NET Crystal Report.

Does anybody know how to to format time in Crystal report ?
I have a database field which contains a datetime value, ie. "1/1/2006 14:02 " (the time is in military time)

I know I can use totext("value", "MM/dd/yyyy") to format a date, but what about formatting a time value as well .

In other words, I want to format "1/1/2006 14:02" into "1/1/2006 2:02 PM"

Thanks,
Hang
 
Right click the field and select format field->Date and Time->Customize->Time->12 Hour

Works in other versions of Crystal, but the .net is limited in many ways.

-k
 
thanks sypnapse ..

also, I just found out that I could use this formula:
totext(cdatetime("1/1/2006 14:02"), "MM/dd/yyyy hh:mm tt")

Thanks,
Hang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top