Forums
This topic is locked
Delete record 3 days after Date field entry
Posted 18 Jul 2001 03:37:52
1
has voted
18 Jul 2001 03:37:52 Julian Hockings posted:
Anyone know how to set something up so that a record is automatically deleted three days after the date in the record's "date" field?Replies
Replied 18 Jul 2001 10:19:33
18 Jul 2001 10:19:33 Viktor Farcic replied:
You can do this directly in SQL Server.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Anyone know how to set something up so that a record is automatically deleted three days after the date in the record's "date" field?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Anyone know how to set something up so that a record is automatically deleted three days after the date in the record's "date" field?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 18 Jul 2001 19:37:27
18 Jul 2001 19:37:27 Julian Hockings replied:
Thanks, but could you be a little more specific?
Replied 25 Jul 2001 23:07:23
25 Jul 2001 23:07:23 Dennis van Galen replied:
Now there's a solid answer, like we all run SQL server...
Crunch, can you provide us some more details on your setup, asp, jsp, cfm ? Jscript, Vbscript ? MS Access, MySQL, SQLserver, Oracle ?
Soo many variations, each wanting their own variations on these type of commands.
Or is it working allready ?
With kind regards,
Dennis van Galen
Webmaster SPG Finance
KPN Telecom Holland NV
Crunch, can you provide us some more details on your setup, asp, jsp, cfm ? Jscript, Vbscript ? MS Access, MySQL, SQLserver, Oracle ?
Soo many variations, each wanting their own variations on these type of commands.
Or is it working allready ?
With kind regards,
Dennis van Galen
Webmaster SPG Finance
KPN Telecom Holland NV
Replied 25 Jul 2001 23:13:24
25 Jul 2001 23:13:24 Julian Hockings replied:
I solved this an hour after I posted, but I left the thread open to see if anyone had different ways of doing it, but it seems people only had different ways of not giving a direct answer. ; )
I used:
DELETE FROM listings WHERE DateAvailable < Date ()
and I let Ultradev do the coding for me. I put the code on my index page as a Command so it gets run any time someone looks at the page, and before any dynamic data is displayed.
I used:
DELETE FROM listings WHERE DateAvailable < Date ()
and I let Ultradev do the coding for me. I put the code on my index page as a Command so it gets run any time someone looks at the page, and before any dynamic data is displayed.
Replied 25 Jul 2001 23:28:19
25 Jul 2001 23:28:19 Dennis van Galen replied:
YES, i see you use Jscript, Date() being the date of today <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Delete if date lower then today. And the date in the dbase is set to 3 days from last pageview...
So, if i understand correctly you want your message/article to be deleted if it hasn't been viewed for 3 days ?
Hmmm, there's a interesting way of saving server space, but what if you want to read them in the future ?
With kind regards,
Dennis van Galen
Webmaster SPG Finance
KPN Telecom Holland NV
Delete if date lower then today. And the date in the dbase is set to 3 days from last pageview...
So, if i understand correctly you want your message/article to be deleted if it hasn't been viewed for 3 days ?
Hmmm, there's a interesting way of saving server space, but what if you want to read them in the future ?
With kind regards,
Dennis van Galen
Webmaster SPG Finance
KPN Telecom Holland NV
Replied 26 Jul 2001 01:11:47
26 Jul 2001 01:11:47 Waldo Smeets replied:
Simply add an extra field to your table: active
When active=1 then the record is available for the public, when active=0 then it is only available for administrators f.e.... depending on how you filter the recordset of course.
Then you could do the maintenance by not deleting the records, but by setting their active field to zero.
Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------
When active=1 then the record is available for the public, when active=0 then it is only available for administrators f.e.... depending on how you filter the recordset of course.
Then you could do the maintenance by not deleting the records, but by setting their active field to zero.
Waldo Smeets - www.UDzone.com Webmaster
------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
------------------------------------------