Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: 'Bad Date Format String' Message Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: 'Bad Date Format String' Message
    Posted: 05 Sep 2012 at 7:15am
Hi,
I am using Crystal Reports 2008. I need to convert a string field to a date field so that I can compare this field to another date field for an audit. The field name that needs to be converted is called "SKILL_SOURCE".  
First, Itrimmed this data field for spaces that were in all the blank records. Then, I converted the Trimmed data field by using CDate.
Then, I did an "isdate" formula to make sure those two records actually read as dates, and they do. They appear as "TRUE"
My final task: Compare the dates in the "SKILL_SOURCE" field to another date field in the report. I continue to receive the message "Bad Date Format String" and the rpeort points me to my trimmed formula. There are no errors on the trimmed formula when I check it in the Formula builder. There are literally 2 dates, everything else is blank and just needed trimming.
 
Before I refresh the report, I can create all kinds of formulas that work like I intend them to; I can check to see if one date is greater than the other. I can check how many days are in between theh two date fields, etc...but as soon as I refresh, I get this message. Please help!!Cry
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Sep 2012 at 8:27am
Is it possible that there is an bad date in the database (would only show up during a refresh)?  Also remember no date is a bad date (check for empty strings and nulls).
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 05 Sep 2012 at 12:13pm
evaluate the table look for values where isdate({field}) = false.

you can also add isdate({field) to your select expert
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 05 Sep 2012 at 1:22pm
I figured this out. I needed to add ({SKILL_SOURCE})<>" " to my Select Expert, then my report worked just fine! Thanks kevlray for your advice "No date is a bad date". That's what made me realize I needed to filter those out first.Smile
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
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.031 seconds.