Temp Table Query not returning results to page
I am using the following query from an ASP page:
select Orders.CustID
into #TempTable
from Orders
join Customers
on Orders.CustID = Customers.CustID
group by Orders.CustID
having count(Orders.CustID) = 1
select count(*) as NewCustomers
from #TempTable t
join Orders o
on t.CustID = o.CustID
where cast(convert(char(10), OrderDateTime, 112) as smalldatetime) = cast(convert(char(10), '11/10/2005', 112) as smalldatetime)
drop table #TempTable
When I run this in Query Analyzer it works fine and returns a column called "New Customers". However, when I run it from the ASP page or even as a stored procedure, the column is not available. Can anyone help me with this? Thanks.
|