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

Convert String to DateTime

Status
Not open for further replies.

vespin

Technical User
Sep 17, 2001
17
US
Is it possible to convert a database field that is formatted as a string value to a date time field? Any help would be greatly appreciated. Thank you very much!
 
Yes, there is a Crystal function that does this.

Write your formula this way:
If IsDate(StringField) then // Checks if the string can be converted to a date
CDate(StringField); // Converts the string

The CDate function is pretty smart and can translate many different formats, but if it doesn't work for your format, tell me how the string is formatted and we can try to manually convert it.
 
CDAte worked great! Thank you very much. I was beating my head against the wall on this one. Sorry for the newbie questions I've been using crystal for 3 days now. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top