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

Format Date/Time to Two Lines 1

Status
Not open for further replies.

ddnh

Programmer
Nov 25, 2002
94
US
I have a date/time field that I need to format so the date is on one line and the time is on the line below. with most fields I can do this by adjusting the field width/heighth...the text wraps. For some reason, the date time field does not wrap.

One solution I have is to insert the field twice, one beneath the other. then format accordingly. I'm just wondering if there is a way I can do it without inserting the field twice. Or is the performance issue with the field inserted twice going to negligible?

field contents: 6/1/2003 2:21:05 PM
I want it to look like:

6/1/2003
2:21:05 PM


 
Performance decrease should be negligible.

You could also create a formula which displays them both, as in:

totext({datetimefield},"M/d/yyyy")+chr(13)+totext({datetimefield},"H:mm:ss")

-k
 
I'd put the field on the report twice, then right click each field and format.

You can make one field display the date only and the other field display the time only.


Reebo
Scotland (Sunny with a Smile)
 
If you could actually benchmark this, I think the BEST performance will be to add the field twice. The field is already in the result set so the database doesn't do any more work. Even a formula would take some small amount of processing. But, I would bet that you won't notice a difference using any of the above techniques.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top