I'm creating a report based on the customer table wherein I extract records that fall within a date range defined by two date picker objects on the screen and one other criteria. If either or both of those fields are empty, I enter default start and/or end dates as necessary. I also save these two date values in a separate unrelated global values table; to be used by the report generator to enter the date range on the report. In the Report Designer this all works fine and as expected. However, when generating the actual report, I get inconsistent results.
If the date range was initially blank, the default dates are entered, and then the report is created. It properly displays the date range from the global values table, but the records retrieved are all records matching the second criteria, and the date range is ignored completely. This also happens if either the start date or the end date is blank prior to running the report. If however, both dates are entered first, then the report extracts the proper records matching both the date range and the second criteria, but will not display the global value dates on the report.
After considerable time and energy trying to determine what is happening, I think it may be related to how date formats are handled in the report generator. I say this because during testing I changed the condition from "within the date range" to" greater than or equal to" the start date value. When the start date was initially blank, the report would generate and select the correct records ( although still not displaying the global date values) If, however, there was an initial value in the start date field, the report would not generate at all and I got an "unspecified error loading the report" error. Screen messages during testing indicate the blank fields are filled with the date format as "6/28/2012" while dates from the field are " Jun-28-2012"
I know this was a rather long and detailed description of the problem, but I felt that was necessary for you to have any chance of reproducing it.
I look forward to your comments on this. Thanks,
Rolf