Copy link to clipboard
Copied
How would I set a recordset to no longer display a record after a certain date has passed?
For example:
I have a list of classified adverts.
After a certain time period, say, 6 months, would it be possible to use some kind of SQL statement to no longer display the advert?
I'm using ASP - VBSCRIPT with an SQL server.
The the date field in the SQL database displays on the page like this 2009-07-23
Thanks
Gary
Copy link to clipboard
Copied
Include this in your SQL statement
WHERE dateExpire_field > Now()
This of course isn't the exact code, I'm not an ASP guy, but this is the concept. This way as long as the date you set your record to expire is "further out" than the current date the record will be pulled. Once the expire date has passed it wont
--
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer
Copy link to clipboard
Copied
Think I may have sussed it anyway (had to convert it slightly), used this statement:
WHERE Date >= cast(convert(varchar(8),getdate()-1,1) as datetime)
This now only displays the record whilst the date column in the table is either greater or equal to the current day
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more