Many to Many Relationship

D

DM - NPS

I am not really sure how to start so I thought the best way was to provide an
example. I have a report (rpt_Main) with a subreport (rpt_Mainsub) linked
via a field called WOKey.

An example of the output

(main report)

Emp Date Value
5/1/2008 10
5/10/2008 20
6/1/2009 30

(sub report)

AssesDate NewField

5/1/2008
5/9/2008
5/10/2008
6/1/2009

What I want to do in create a field in the subreport that looks at the
EmpDate field in the main report and if it is = to the AssesDate then it
populates NewField with the # in the value field from the main form. If
there are no matching dates between the main report and the subreport (as in
the case with 5/9/2008 in my example) then I want to populate NewField with
the value from the main form that is associated with the nearest date that is
less then the date from the subform. So the desired output for my example
would look like this


(main report)

Emp Date Value
5/1/2008 10
5/10/2008 20
6/1/2009 30

(sub report)

AssesDate NewField

5/1/2008 10
5/9/2008 10
5/10/2008 20
6/1/2009 30

Any help would be much appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top