Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Don't need all dates 1

Status
Not open for further replies.

cretanion

Technical User
Jan 28, 2002
53
US
Running a report just for the month of Oct 2002 and the days of the week are 10/06/02 to 10/12/02. Why does the report show Support Calls opened in 2001 during Oct.? Using Crystal 8.5 Pro.

{Incident.Open Date} in "10/06/2002" to "10/12/2002"
 
What is this "10/06/2002" action you've got going on here? This suggests that {Incident.Open Date} is actually a string field, and not a date field at all.

This being the case, Crystal will not attempt to recognise 10/06/2002 as being a date. Instead, it sees it as a string of letters which is included in the range you've specified.

You need to convert the field to a date first:

Date({Incident.Open Date}) in Date(2002,10,06) to Date(2002,10,12)

Good luck with your report,

Naith
 
Do you think the database is the problem or is this a Crystal glitch?

Just to confirm your answer is correct!!! thanks!!!
 
It's actually bad database design to store date data as strings. All databases have date datatypes - which are what should be used to store dates.

Crystal's just working with what it's been given. There's no way it could no that that field was supposed to be a date field just because it's called "Open Date". Because the database is telling Crystal that it's a String field, Crystal just takes the database's word for it.

Unfortunately, because of the way your database has been designed, every time you want to query an Incident.OpenDate date range, you'll need to convert it to a date first - and not just in Crystal - but in any application where you're trying to extract values from the database.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top