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

String To Date Function

Status
Not open for further replies.

coolbrian

IS-IT--Management
Nov 21, 2002
1
0
0
AU
How do I convert a string into a purely date format?
Example, I have a field contained "20020904" in string format and would like to convert this into date format?

Any ideas?
 
There's a fair few ways you could do this.

Here's one of many:
Code:
WhilePrintingRecords;
StringVar DT := {YourDate};

Date(Mid(DT,1,4)+","+Mid(DT,5,2)+","+Mid(DT,7,2))

All the best,

Naith
 
If this field is a number:

NumberToDate({yourField})

If it is a string:

NumberToDate(ToNumber({YourField}))

NumbertoDate() is available on the Crystal Decisions website as a download. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top