Print Page | Close Window

"A string is required here" error message...

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16845
Printed Date: 19 Apr 2024 at 1:09pm


Topic: "A string is required here" error message...
Posted By: TC Tran
Subject: "A string is required here" error message...
Date Posted: 25 Jun 2012 at 5:35am

Hello,

 
I am rebuilding a report that was originally created out of the Business View data source and creating a new report out of the ODBC data source connection.  There is a formula that works in the Business View but when I create the same formula in ODBC I get the "A string is required here" error. 
 
The formula is: DTSToDate ({Incdnt.AffctdPersnDOB}).  I have the same exact number of tables and correct joins but don't know why I get the error message.  I really appreciate any guidances.

Thank you,
Thanh



Replies:
Posted By: kevlray
Date Posted: 25 Jun 2012 at 6:43am
Is your field {Incdnt.AffctdPersnDOB} a string.  If not you will need to convert it to a string for the DTSToDate function.


Posted By: TC Tran
Date Posted: 25 Jun 2012 at 7:17am
Hi Kevlray,
 
Thank you so much for responding to my post!  Oh, it's a DateTime.  The otehr version was converted to a String.  How do you convert a dateTime to a String format?
 
I really appreciate your help!!!

Thanh
 


Posted By: kevlray
Date Posted: 25 Jun 2012 at 12:46pm
I think we to step back and see what you are trying to accomplish.  The DTSToDate takes a Date Time String and converts it to a date.  Since you have a Date Time value, if you just want the date, then use Date({Incdnt.AffctdPersnDOB}.  If you need a string from the Date Time, then you can use the Cstr function (look at the help for the options).


Posted By: TC Tran
Date Posted: 28 Jun 2012 at 10:36am

Kevlray,

Thanks again for the reponse!  I replaced the DTSToDate function with  he Date function and it worked!  Thank you!  I'm not exactly sure why my former co-worker converted the field type from DateTime to String.  I'm curious how he was able to convert the field type from the table from DateTime to String.
 
I appreciate you for helping me with this issue!  Have a great day!
 
Thanh



Print Page | Close Window