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

Date Conversion in 7.0

Status
Not open for further replies.

Joelcc

Programmer
Feb 9, 2005
6
US
Hello,

Using Crystal 7, and have a string (20050215) that I'm trying to convert to a Date field 02/15/2005, but have not found a function to do that in 7.0.

I appreciate the help
 
Try:

if len({table.date}) = 8 then
cdate(left({table.date},4),mid({table.date},5,2),mid({table.date},7,2))
else
cdate(0,0,0)

Note that any calculations/aggregates against this formula would then verify that the @dateformula <> cdate(0,0,0) as this identifies an invalid date.

-k
 
Download the NumberToDate() function and write a formula like this:

NumberToDate(val({YourField}))

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top