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!

group select problem

Status
Not open for further replies.

mwhalen

Programmer
Oct 31, 2000
217
CA
Hi. I have an address table that I'm using in a subreport. I want the most recent address for the customer id and so I do a group select. The problem is say I have about 5 different addresses for each customer - some might be inactive addresses and some might be active (address status = A or I). As it turns out, I am getting the most recent address but in some cases the most recent address is inactive. As well I do have in my record selection criteria where address status = A. It's almost as if the group select runs separate from the record select. Is the only way around this to hard code the sql in my sub report?

Thanks!





 
you aren't giving us much information. You should print out your Record Selection formula and Group selection formula

I don't hink you need a group selection formula actually.

Assuming for each customer the active address is the most recent then this should be sufficient

Record select formula

{table.addressStatus} = "A";

if it isn't (say there are 2 addresses with "A" for a given company)then there must be a "most recent" identifier...perhaps a time stamp in the database that can be used. Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top