Forums
This topic is locked
date expiry in access
Posted 24 Jan 2003 18:23:00
1
has voted
24 Jan 2003 18:23:00 Wayne Hultum posted:
Could someone help?I have a database where people can place adverts. When the user submits an advert the date is added to a date field within the database.
What I want to do is set the advert to expire after a certain amount of time.
Hope I've explained in enough detail
Thanxs in advance.
Replies
Replied 24 Jan 2003 21:55:29
24 Jan 2003 21:55:29 Dave Clarke replied:
Hi
To delete the advert automatically you need to have a date field - fldAdvertDate - in the table where the ads are - tblAdverts - giving the date that it was submitted.
Then using the databindings dropdown choose COMMAND (Stored Procedure) make a Delete command along these lines
DELETE FROM tblAdverts
WHERE ((tblAdverts.fldAdvertDate<Date()-28))
This will delete all the records older than 28 days, everytime the page where the Command is is opened.
Hope this helps
ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
To delete the advert automatically you need to have a date field - fldAdvertDate - in the table where the ads are - tblAdverts - giving the date that it was submitted.
Then using the databindings dropdown choose COMMAND (Stored Procedure) make a Delete command along these lines
DELETE FROM tblAdverts
WHERE ((tblAdverts.fldAdvertDate<Date()-28))
This will delete all the records older than 28 days, everytime the page where the Command is is opened.
Hope this helps
ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
Replied 15 May 2007 15:14:21
15 May 2007 15:14:21 Warren Marris replied:
I have a similer problem...
I have constructed my own Job Search Database to help me with finding work. In this I have linked a table and form for Mail Merge to do written applications.
My Problem comes form the fact that when I print... I get letters that are out of date as well as it prints from all records.
All the data has an expiry date for applications but I do not actually know how to get Access to recognise or delete an expired record.
It may also help to point out that I am using Enterprise Edition of Microsoft Ofice... I know! I only made things harder for myself but hope you can give me some help.
I have constructed my own Job Search Database to help me with finding work. In this I have linked a table and form for Mail Merge to do written applications.
My Problem comes form the fact that when I print... I get letters that are out of date as well as it prints from all records.
All the data has an expiry date for applications but I do not actually know how to get Access to recognise or delete an expired record.
It may also help to point out that I am using Enterprise Edition of Microsoft Ofice... I know! I only made things harder for myself but hope you can give me some help.