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

How do I repeat records based on a date

Status
Not open for further replies.

uwwgrad

MIS
Feb 22, 2011
1
US
I have a patient report that needs an individual line item for each day they are connected to a machine. So if the start date is 1/1/2011 and the end date is 1/4/11 I would need for intividual line items based on the calculation between start date and end date. The only difference in each line would be the date that appears on the line. So the report would look something like this

Name Date MR
John Doe 1/1/11 123456
John Doe 1/2/11 123456
John Doe 1/3/11 123456
.
.
.
 
It has been awhile since I did this, but I believe if you group by the patient and in the patient group footer put a formula something like this.

datediff ("d",minimum({Date},group_name), maximum({Date}, group_name))

I hope this helps.
 
I think you would have to create a table in Excel or some other application that contains all possible dates, and then use a left join FROM that table TO your main table, linking with a >= join from the new table.date to the start date of the main table, and a <= join from the new table to the end date of the main table. For this to work you would only be able to add selection criteria on the all dates (new) table--not on the main table.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top