August 16th, 2012, 03:26 PM
Join Date: Sep 2011
Time spent in forums: 3 h 6 sec
Reputation Power: 0
Originally Posted by Doug G
Oh, I didn't realize you just wanted copy & paste code without understanding. Sorry.
From your grumpy comment I realized I must have done something unnecessary in the code. So I looked through it and figured the for loop was stupid of me to add.
Now my code is:
conn.ConnectionString = "DSN=forsale"
sql = "SELECT Subject, DatePosted FROM ForSale WHERE ((([DatePosted])<Now()) And (([DateRemove])>Now() Or ([DateRemove]) Is Null)) And ((([Display])=True)) ORDER BY DatePosted DESC"
set rs = conn.execute(sql)
do until rs.EOF
If rs("DatePosted")> DateAdd("D", -14 , Now) Then 'no posts over 14 days old
Response.Write("<li><a href=/ForSale/forsale.asp#" & Replace(rs("Subject"), " ", "") & "'>" & rs("Subject") & "</a></li>")
rs.MoveNext 'next row
Everything in the code (except the do until rs.EOF and the variable names) are mine. I also understand everything in the code. Still grumpy?