Quote:Original post by chbrules
Nevermind, I just figured it out myself:set dater = Server.CreateObject("ADODB.RecordSet") dater.Open "SELECT * FROM TradeshowTimes WHERE Tradeshow_ID = '" & rs("Tradeshow_ID") & "' ORDER BY Tradeshow_ID ASC", sConn, 1, 2, 0 Response.Write Replace( dater("Setup_Date"), "/" & year(dater("Setup_Date")), "" ) & " - " dater.MoveLast Response.Write Replace( dater("Setup_Date"), "/" & year(dater("Setup_Date")), "" )
I hope that's not too sloppy. I get quirk at blank fields though, I'll have to do error checking too on it.
Unbelievably ugly, and totally inefficient. If there is more then one tradeshow on the report and you are thus repeating this code, you should be sent to SQL jail. You have caused a ton of records to be pulled from the database that you aren't even going to use.
As I've tried to explain to you all along, the correct method, taught on the first day, is this:
dater.Open "SELECT Min(Setup_Date) AS StartDate, Max(Setup_Date) AS EndDate FROM TradeshowTimes WHERE Tradeshow_ID = '" & rs("Tradeshow_ID") & "' GROUP BY Tradeshow_ID ", sConn, 1, 2, 0 Response.Write Replace( dater("StartDate"), "/" & year(dater("Setup_Date")), "" ) & "<font size='2'> - </font>" Response.Write Replace( dater("EndDate"), "/" & year(dater("Setup_Date")), "" )