Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Reference Objects

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2004-12-29 : 14:54:45
Hello. Since no one from T-SQL or Reporting Services is able to help me out with this one, hopefully someone in here might be able to since what I'm doing is related to ASP.NET

The problem that I'm having is that I'm migrating some reports from ASP website to Reporting Services. From ASP, I was able to reference objects and use it in the Where clause of my SQL Query. I can't seem to figure this out in the SQL Query level on how to get it to work.

Here's the example:

Example:
SELECT CUST_ID, EMP_ID, SALES_ID
FROM CUSTOMER, EMPLOYEE, SALES
WHERE CUSTOMER.CUST_ID = '3232'

The second query will display the Sales_Amount base on the object from the first query.

SELECT SALES_AMOUNT
FROM CUSTOMER, EMPLOYEE, SALES
WHERE CUSTOMER.CUST_ID = '"&CUST_ID&"'
AND EMPLOYEE.EMP_ID = '"&EMP_ID&"'
AND SALES.ID = '"&SALES_ID&"'

These are the objects:

'"&CUST_ID&"'
'"&EMP_ID&"'
'"&SALES_ID&"

I have use a left outer join, but I'm getting an aggregate error. A lot of my reports reference objects so I'm not sure how to go about getting it to work at the SQL level. Can anyone point me to the right direction.

To see the actual query that I'm working with please go to the link below.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=44087


Thanks in advance.
   

- Advertisement -