using temp table in R3
I have to use temp table to pull data together and do calculations, i.e.
Select name, address, age, area from table_1 into #tempt 1
Select name, address, age, area from table_2 into #tempt 2
Select * into #tempt 3 from #tempt 1
insert into #tempt 3 select * from #tempt 2
Select AVG(age) from #tempt3 where area <> 1
The above works in SQL, but not in R3. The error message is:
An item with the same key has already been added.
Please could anyone help
August 31st, 2012 7:47am
Hi,
Can you give a clear picture of your problem,
Why do you want temp tables ,if you hav same columns why can't you go with a union.
Thanks
Esmari
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2012 7:52am
Hi TYHGWAS,
I agree with Esmari that you can try the UNION operation to combine the results of two queries into a single result set. For more information, please see:
UNION (Transact-SQL)
In addition, the Lookup() function was introduced in SQL Server 2008 R2 Reporting Services. By using the lookup function in the expression in Reporting Services, we can retrieve the first matching value for the specified name from a dataset that contains
name/value pairs. For more information, please see:
Lookup Function
If you have any questions, please feel free to ask.
Regards,
Mike Yin
Mike Yin
TechNet Community Support
September 8th, 2012 7:53am