Consider left joins:
select 1.a,1.b,1.c,1.d,1.e,2.f,2.g,2,h,3.i,3.j.....
from (1 left join 1 on 1a=2a and 1b=2b and 1c=2c) left join 3 on 3.a=2.d......
It might work better than a stored procedure.
I have used ADO in VB scripits, but not for asp.
rbrown@edium.com (Robert Brown) wrote in message news:<bdd1819.0308281817.13ff73f6@posting.google.c om>...
> Hi All.
>
> I have been writing simple single stored procedures for a few years
> now, but a client needs some reports (under Crystal) that I seem to
> think the only way to get the data (from SQL2000) is to build up a
> results set using a stored procedure with multiple select statements,
> interrelated.
>
> What I mean is this..
>
> I have a Select statement that gathers information from one table.
> Lets say 5 fields.
>
> Then, the next select statement uses those two of those five fields to
> get more data (lets say 15 fields), which then I have to join with the
> data from the first select statement based on the result.
>
> Then, I have another select statement after that, that uses 2 fields
> from the second select statement on the 1st and 2nd statement results.
>
> The last step is to pass this all back to either the Crystal reports
> or to a vb.aspx application (which I know how to call the stored
> procedure from these two apps).
>
> Now, I know it is a big ask, but is there some website, or good
> documentation on how to do this (or similar)? I am trying to do too
> much with the stored procedure? If you know how to do this, could you
> give an example...
>
> Thanks,
> Robert