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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Error in Grouped Field display 1

Status
Not open for further replies.

pavandyke

Programmer
Feb 11, 2005
22
US
I am using Crystal Reports 10.

Oracle database. I have a date field that is my primary group field. One of the dates is 1/1/1700. This was a default value of some sort in this database as there are a number of occurrences of this date. If I put this field on the report it displays fine as 1/1/1700. However, the group tree and group name field are showing this as 12/27/1699. Could this be related somehow to faulty leap year logic calculations in crystal? I believe it is true that 1700, 1800 and 1900 were not actually leap years. I have heard somewhere that for the years ending in 00 the century portion must be divisible by 4 to actually be a leap year. I do not know if this is the issue here or not. Just curious if anyone else has run into this type of an issue with older date fields.


 
I'm surprised that such old dates work at all. It is right that 'century years' are not leap years unless the entire year is divisible by 4, as was true for 1600 and 2000. (I've also encountered code that specified 2000 was NOT to be a leap year, someone had the wrong rule.)

If the data handling is a problem, you could convert it to text, except you'd then need to make it YYYY/MM/DD to get the sorting order correct.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Are you grouping by week? The group field will show the beginning of the week, not the first instance in the data for that week.So what are you grouping on? Is it a formula? On change of what?

-LB
 
Tested this, and 12/27/1700 is the Sunday of the week containing 1/1/1700--so it it just because you are grouping by week.

-LB
 
Thanks lbass. You were exactly right. There were not many transactions that met the criteria for showing on the report and none of the "real" dates stuck out as being an issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top