Click to See Complete Forum and Search --> : Showing image if DB record is new


ProperBo
11-15-2003, 07:00 AM
Hi all,

trying to figure out how to show a new image next to a record in the DB that is less than 7 days old.

It's placed in a repeating region, and pic shows for all records, not just the new ones :(


<%
DIM strRecordDate, strNew

strRecordDate = rsArticles.Fields.Item("DateAdded").value
strNew = response.write ("<img src='newPost.gif'></img>")

IF strRecordDate <= Date()-7 THEN

response.write (strNew)
ELSE
END IF
%>


any pointers would be great
TIA

ProperBo
11-15-2003, 04:16 PM
Sorted it :)

Heres the code if anyone else ever needs to use it


<%
DIM strDate, strNew
strDate = rsYourRS("DateField")
strNew = "<img src='new.gif'>"
IF (DateDiff("d", Date(), strDate) >= -7) THEN response.write strNew
END IF
%>


see it in action > http://www.nova-cs.co.uk