|
-
Oct 4th, 2007, 04:12 PM
#1
Thread Starter
Junior Member
[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!
-
Oct 4th, 2007, 04:38 PM
#2
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.
-
Oct 5th, 2007, 09:49 AM
#3
Thread Starter
Junior Member
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?
-
Oct 5th, 2007, 10:03 AM
#4
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?
-
Oct 5th, 2007, 10:06 AM
#5
Thread Starter
Junior Member
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.
-
Oct 5th, 2007, 10:16 AM
#6
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.
-
Oct 5th, 2007, 10:27 AM
#7
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|