Print Page | Close Window

'Bad Date Format String' Message

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17499
Printed Date: 27 Apr 2024 at 2:21am


Topic: 'Bad Date Format String' Message
Posted By: thummel1
Subject: 'Bad Date Format String' Message
Date 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



Replies:
Posted By: kevlray
Date 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).


Posted By: comatt1
Date 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


Posted By: thummel1
Date 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



Print Page | Close Window