Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: A field is required bad data format error Post Reply Post New Topic
Author Message
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Topic: A field is required bad data format error
    Posted: 28 May 2010 at 5:01am
Hi,
 
I have a field called XDESC2, this field is defined as varchar2 in the backend even though the field has date/time value saved in it. The date is saved in ddmmyyyy format. I got a request from the user to add 90 dates to date, so I wrote below formula which worked:
 
Dateadd('d', 90,(cdate({UDEFTAB.XDESC2})))
 
Now the user is asking me to change the record selection formula to include XDESC2 field as well when the field is not null. In another words is to display the values on the report whenever this field contains data.
 
The current selection formula is as below:
(not isnull({UDEFTAB.XDESC1})
 
I changed the existing record selection formula to:
 
((not isnull({UDEFTAB.XDESC1}) or (not isnull({UDEFTAB.XDESC2}))
 
 
After I added XDESC2 to the selection formula, I got error message complaining about the first formula is a bad date format string.
 
I thought may be because in my first formula I changed the data type to date, I might need to add cdate, (not isnull(cdate({UDEFTAB.XDESC2})), but this did not help either. By doing so, I got a field is required here error message.
 
Can someone please tell me what I am missing here?
 
Thanks,
Lava


Edited by lsalih - 28 May 2010 at 5:04am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Jun 2010 at 3:32am
it could be the 'or'.  That xdesc2 is not null, but xdesc1 is null and that causes the report to error later on.  Sounds like, from the description, that you want an 'AND', not the 'or'
HTH
IP IP Logged
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Posted: 01 Jun 2010 at 8:56am
I am certain is my OR statement, but I do not want to use AND. What I want is to display data whenever desc1 or desc 2 or desc 3 contains data. Do you know of any better logic to write this?
 
Thanks,
Lava


Edited by lsalih - 01 Jun 2010 at 8:57am
IP IP Logged
lsalih
Groupie
Groupie


Joined: 27 Sep 2007
Location: United States
Online Status: Offline
Posts: 44
Quote lsalih Replybullet Posted: 01 Jun 2010 at 9:02am
Thank you for your reply, it was the OR causing the problem. I had to change it to
 
(((desc1) or (desc2)) or (desc3))
crazy but works now....
 
Thanks,
Lava
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.016 seconds.