le*****@yahoo.com wrote:
Thanks for your response.
In SP1 I have, beside others, fields Article and Date and the same
fields + field AvgPrice in SP2. I want to calculate avg price for some
article until some date. Fields articles are related 1-to-1 and I get
corect avgprice without date limit.
Now, I would like to compare Dates and set criteria like: Date from SP2
<= Date from SP1.
Regards,
It sounds like what you want are tabular functions, not stored
procedures (assuming you're on SQL Server 2000 or newer). You can use
tabluar functions like views except that you can pass parameters to
them, so you can do a select that joins the output of fn1 and fn2 based
on some criteria.