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

Indicate Missing Dates on a Report

Status
Not open for further replies.

RSfromCO

Programmer
May 3, 2002
149
US
I have a query that returns the following type of results.

StartDate EndDate RecordDate
1/1/2003 1/31/2003 2/10/2003
2/1/2003 2/28/2003 3/10/2003
3/1/2003 3/31/2003 4/10/2003
4/1/2003 4/30/2003 5/10/2003
etc....

I have created a report showing this information.

I would like to include a flag in the report to indicate if the StartDate of a line is more than the EndDate + 1 day of the line above it (indicating there is a gap in the data). I am not sure how to "store" the end-date of the line above in a report however to do any comparison.

Any suggestions ???
 
Add a hidden unbound control on the report; call this LastEndDate, and initialise it on the reports OnOpen event to be equal to the StartDate-1 of the first record.

Then on the OnFormat event of the report, you can compare the unbound control to the bound StartDate-1, and based on the result, populate a second new unbound (but visible) control on the report with a value, depending on whether equality is achieved or not.

After this you would have to assign the unbound LastEndDate control of the report, with the value of the current records EndDate.

Hope this is clear; probably looking at no more that ten lines of code total in the two events.


Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top