Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Integer to date error Post Reply Post New Topic
Author Message
mjoshua
Newbie
Newbie


Joined: 11 Sep 2015
Online Status: Offline
Posts: 1
Quote mjoshua Replybullet Topic: Integer to date error
     Posted: 15 Sep 2015 at 8:27am
Hi,
I was hoping someone could help me on why I am getting an error that states "The result of selection formula must be a boolean". In my formula editor I have the following formula written.

ToText({Data.Issue_Date},"MM/dd/yy")

I have my report connected to an access database and I have an issue date field that is set as a Number. The issue date field has the first two numbers as the month, the next two numbers as the day, and the last two numbers as the year.

ex.
120415
030714
090110

What I am trying to do is have the issue date field report as

ex.
12/04/15
03/07/14
09/01/10

This then I could search for records within a certain month period. I am not sure if the formula is written incorrectly or if the data in the database may be an issue. Hope some one can help.

Thanks,
Josh
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 Sep 2015 at 4:55am
You need to put the  ToText({Data.Issue_Date},"MM/dd/yy") in a formula and then use that formula as part of the selection criteria, but it is still a string.  

What might work better (in a formula) is to convert it to a  date:

date(tonumber('20'+right({datefield},2)),tonumber(left({datefield},2)),tonumber(mid({datefield},3,2)))

hopefully I did not miss any parens.
IP IP Logged
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