Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another SQL problem

Status
Not open for further replies.

taval

Programmer
Jul 19, 2000
192
GB
right now I have the following asp code:<br><br><br>IDfield=&quot;CustID&quot;<br>scriptresponder=&quot;edcustomer.asp&quot;<br>scriptresponder2=&quot;record.asp&quot;<br><br>set conntemp=server.createobject(&quot;adodb.connection&quot;)<br>conntemp.open myDSN<br><br>StrQuery = &quot;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&nbsp;&nbsp;Order By f.CustId&quot;<br>srt = &quot;Select tempererer.CustId,Customer.CustName,tempererer.LastDate from Customer, tempererer where Customer.CustID = Tempererer.CustId&quot;<br><br><br><br>set allcust=conntemp.execute(StrQuery)<br>set allcust=conntemp.execute(srt)<br>allcust.movefirst<br><br><br>%&gt;<br>&lt;table align = center cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; BORDER=&quot;0&quot; WIDTH=&quot;600&quot; &gt;<br>&lt;tr&gt;&lt;td align= &quot;center&quot; width=&quot;70&quot; bgcolor=#CCCCCC &gt;&lt;/td&gt;<br>&lt;td align= &quot;center&quot; width=&quot;100&quot; bgcolor=#CCCCCC &gt;Customer ID&lt;/td&gt;<br>&lt;td align= &quot;center&quot; width=&quot;150&quot; bgcolor=#CCCCCC &gt;Customer Name&lt;/td&gt;<br>&lt;td align= &quot;center&quot; width=&quot;130&quot; bgcolor=#CCCCCC &gt;Last Backup&lt;/td&gt;&lt;/tr&gt;<br> &lt;%<br><br> While Not allcust.EOF <br><br>%&gt;<br>&lt;TR&gt;&lt;TD align= &quot;center&quot; BGCOLOR=&quot;#99FF99&quot;&gt; &lt;%my_link=scriptresponder & &quot;?id=&quot; & allcust(idfield)%&gt;<br>&lt;a HREF=&quot;&lt;%=my_link%&gt;&quot;&gt;Update&lt;/a&gt; &lt;/TD&gt;<br>&lt;TD align= &quot;center&quot; BGCOLOR=&quot;#99FF99&quot;&gt;&lt;% Response.Write allcust(&quot;CustID&quot;) %&gt;&lt;/TD&gt; <br>&lt;TD BGCOLOR=&quot;#99FF99&quot;&gt;&lt;%my_link=scriptresponder2 & &quot;?id=&quot; & allcust(idfield)%&gt;<br>&lt;a HREF=&quot;&lt;%=my_link%&gt;&quot;&gt;&lt;%Response.Write allcust(&quot;CustName&quot;) %&gt;&lt;/a&gt;&lt;/TD&gt; <br>&lt;TD BGCOLOR=&quot;#99FF99&quot;&gt;&lt;% Response.Write allcust(&quot;LastDate&quot;) %&gt;&lt;/TD&gt;&lt;/tr&gt;<br> <br> &lt;%<br> allcust.MoveNext<br> response.flush<br> Wend %&gt;<br> &lt;/Table&gt;<br> &lt;% <br><br>------------------------------------------<br><br>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?<br><br>Grateful for any help, thanks.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top