September 11, 2008 at 2:32 am
Morning,
I have a request from one of my clients to produce a report that lists all his client information and fee details. My problem is that all the fee information is contained in the one table and I need to pass the query three different paramater values for Directors fees, Takeon fees and Fee listing.
Obviously if I use the where statement to filter my recordset I will exclude the records that don't have values for all of the parameters.
I have seen how subqueries can overcome issues like this by effectively running recursive selects on recordsets but I am not sure if this is the way to go. I have produced a couple of basic subqueries but if anyone who has more experience could guide me as to the suitability of the method or suggest a better approach I would be very grateful.
Thank you kindly,
H
September 11, 2008 at 5:24 am
September 12, 2008 at 1:57 pm
If I understood you right...could you join to the same table a multiple times to get the different information...something like this...
You would join to the Fees table on the client, but each time only join for the Fee type you are looking for.
Not the best performing query...but...
select * from clienttbl
left outer join feestbl fee1 on clienttbl.id = fee1.id and fee1.type = type1
left outer join feestbl fee2 on clienttbl.id = fee2.id and fee2.type = type2
left outer join feestbl fee3 on clienttbl.id = fee3.id and fee3.type = type3
hope this is helpful...
K
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply