[RESOLVED] Converting a string to a date?
Hi all
I have a field in my report that is a string which accepts dates from my database.
The data in the database is stored as a string in the format "20070817" , i wish to be able to format it in ways such as "Wednesday, November 12, 2007" for example.
Can any one tell me how to do this?
Thanks!
:afrog:
Re: Converting a string to a date?
Create a formula that converts the string to a date. Something like (Crystal syntax)
DateValue(Left({Date Field},4) + "/" + Mid({Date Field},5,2) + "/" + Right({Date Field},2) )
Since the formula returns a date, you can now format/display it anyway you want.
Re: Converting a string to a date?
hi bruce,
thanks for helping me, the problem with any date formula that i try to do is that i get a "The result of selection formula must be boolean". any idea why this is?
Re: Converting a string to a date?
Where are you creating the Formula? Are you trying to create a conditional formula for one of the formatting options?
Re: Converting a string to a date?
Im "right clicking" the field that holds the string of data. then i go to "select expert" and i try to type in the formula there. :(
Re: Converting a string to a date?
The "Select Expert" is probably for data retrieval, ie the Where clause of a SQL statement.
Delete the string field from the report.
Create a new formula using the code I posted earlier.
Add the formula to the report.
Right click the formula field and format it accordingly.
Re: Converting a string to a date?
ahhhh, im such a newb! :p
thanks again for your help! :wave: :afrog: