jbulldog (4/15/2013)
Thanks Lowell for the quick reply. But when I altered the code as you presented it the query returned nothing. I would be satisfied if that were the case but I know that there are account portfolios missing this service.Best Regards,
yeah the pseudo code you posted makes it hard to really see any issues.
use the IF code tags, and paste the real query you are testing with , at a minimum.
The suggestion about DDL and sample data would allow any of the volunteers here to give you a working, tested solution, instead of guesses.
you also might consider using CTE's to organize the data , but it really depends on your query.
Lowell