I have two SQL queries in an asp script of mine, which looks like :
-----------------------------------
set conntemp=server.createobject("adodb.connection"
conntemp.open myDSN
StrQuery = "SELECT f.CustId, max(fd.UploadDate)as LastDate into tempererer from FileDescription f, FileDescription fd, Customer where f.CustId = fd.CustId and f.FileID = fd.FileID Group by f.CustId Order By f.CustId"
srt = "Select tempererer.CustId,Customer.CustName,tempererer.LastDate from Customer, tempererer where Customer.CustID = Tempererer.CustId"
set allcust=conntemp.execute(StrQuery)
set allcust=conntemp.execute(srt)
allcust.movefirst
-----------------------------------
As you can see I have two queries executed on the recordeset, this creates a new table called tempererer and this creates problems when the query is run more then once, How would I write my SQL query to give me the same effect without creating a new table? I was also wondering that I could delete the table after I have created it? How would I do this? Would/Could this create problems?
I perform both queries (StrQuery and srt) on the same recordset (allcust). The first query (StrQuery) executed on the recordset creates a table arccording to the requirements stated in StrQuery string. I then run another query on the same recordset (allcust) to get the required details. My problem is that because I create a new table this causes problems, how would I be able to achieve the same results from the queries without creating a new db table. Hope that clears things up.
Grateful for any help thanks.
-----------------------------------
set conntemp=server.createobject("adodb.connection"
conntemp.open myDSN
StrQuery = "SELECT f.CustId, max(fd.UploadDate)as LastDate into tempererer from FileDescription f, FileDescription fd, Customer where f.CustId = fd.CustId and f.FileID = fd.FileID Group by f.CustId Order By f.CustId"
srt = "Select tempererer.CustId,Customer.CustName,tempererer.LastDate from Customer, tempererer where Customer.CustID = Tempererer.CustId"
set allcust=conntemp.execute(StrQuery)
set allcust=conntemp.execute(srt)
allcust.movefirst
-----------------------------------
As you can see I have two queries executed on the recordeset, this creates a new table called tempererer and this creates problems when the query is run more then once, How would I write my SQL query to give me the same effect without creating a new table? I was also wondering that I could delete the table after I have created it? How would I do this? Would/Could this create problems?
I perform both queries (StrQuery and srt) on the same recordset (allcust). The first query (StrQuery) executed on the recordset creates a table arccording to the requirements stated in StrQuery string. I then run another query on the same recordset (allcust) to get the required details. My problem is that because I create a new table this causes problems, how would I be able to achieve the same results from the queries without creating a new db table. Hope that clears things up.
Grateful for any help thanks.