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!

Are any dates returned by subreport within 3 days of clinic visit 1

Status
Not open for further replies.

porkNbean

MIS
Oct 19, 2011
2
US
Hi,

I have a running total field in my main report which returns the last clinic visit for a patient. (i.e. 10/11/2011)

I also have a subreport (dictation_subreport.rpt)that looks for any dictations for this patient and pulls the date(s) they were created.

I need to compare the clinic visit date (if one exists) with the date(s) for the dictations (if any exist). If there are any dictations dates within 3 days after the clinic visit, I want to show that date on my main report.

Thank you for your help in advance,

porkNbean

 
Why are you using a running total? If you can group on the patient field and then create a formula like this:

//{@maxdt}:
maximum({main.date},{main.patient})

...you can use this formula as a linking field to the subreport date field. Then go into the subreport->report->selection formula->date and change the formula to:

{dictation.date} >= {?pm-@maxdt} and
{dictation.date} < {?pm-@maxdt}+4

-LB
 
PS. the sub should also be linked on patient.

-LB
 
I use the running total because my users do not always enter data in the correct order or when they should... so the entries are not always chronological.

Thank you very much for the help... I'll give it a shot manana!

Thanks again,

porkNbean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top