Tips and Tricks
 Crystal Reports Forum : Crystal Reports .NET 2003 : Tips and Tricks
Message Icon Topic: "A string is required here" error message... Post Reply Post New Topic
Author Message
TC Tran
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 19
Quote TC Tran Replybullet Topic: "A string is required here" error message...
    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
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
TC Tran
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 19
Quote TC Tran Replybullet 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
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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).
IP IP Logged
TC Tran
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 19
Quote TC Tran Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.018 seconds.