Print Page | Close Window

convert date to string

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1662
Printed Date: 19 Apr 2024 at 9:14am


Topic: convert date to string
Posted By: botete
Subject: convert date to string
Date Posted: 09 Nov 2007 at 11:19pm
Hi and Good day;
 
Im creating a formula field in CR, that consist of a date and text, I searched the Function and even Operator tabs, but can't seem to find, everytime I try to save it says that there's an error in formula.
 
my date looks like this... yyyy-mm-dd
 
and I'd like to add a text before the date field but all of them as a single formula field, also I'd like the date to be displayed as mm/dd/yyyy.
 
Please help. Thanks.
 
Bo Smile



Replies:
Posted By: IdoMillet
Date Posted: 11 Nov 2007 at 10:51am
Create a formula like this:

"Your Text that comes befor the date " + ToText({your_date_field},"MM/dd/yyyy")

Notice the MM must be upper case.  lower case mm's are for minutes.

- Ido


-------------
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com


Posted By: botete
Date Posted: 12 Nov 2007 at 6:45pm
Sir, seems that the syntax is ok, there's no error anymore when I saved the formula. Thanks Ido.
 
Bo Smile



Print Page | Close Window