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

max date in a subreport with only one table

Status
Not open for further replies.

mwhalen

Programmer
Oct 31, 2000
217
CA
is something wrong in my logic here? I have a subreport with only one table. No grouping on my subreport or on my main report. On my main report I'm passing a field called desaccountcode. The reason I have a subreport is to get a decode description for my desaccountcode. However, the descriptions can have various effective dates. I've used max date before but I seem to be having a lot of trouble with this one. Is the fact that I'm not grouping creating a problem? Or is there a trick to passing my code and then using it in the SQL of my subreport?
 
What do you mean your pass a field, are you linked on that field, are you using a shared variable, or???

I'd do this on the database side, it's much simpler and efficient.

Group on the date effective date field in your subreport. and suppress the Group Header and Details, in the Group Footer, place the fields you want to display, it will always be the largest date data.

-k kai@informeddatadecisions.com
 
what I mean by passing is the parameter that my subreport is linked on, ie. the desaccountcode.

I can't do any grouping in my subreport - I want to see detail lines only
 
You could

a) use top 10 (or one in your case) on the date
b) sort the subreport by date descending and suppress everything where record number <> 1.


You can't select on Max when not grouping..

Lisa


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top