Syntax problem

coos

New member
Local time
Today, 23:48
Joined
Nov 11, 2003
Messages
8
Hi, thanks for your time! :D

I'm stuggling with the simple stuff, and I'm pretty sure it's a syntax thing.

I'm helping a friend with her accounts (access offline) program, and need to basically automatically and continually delete any records that are over three months old.

The records are stored in a 'REPAIR' table in the format 'dd/mm/yy'

Being used to php, I would just convert the date to unix timestamp, and run a loop such as:

delete from 'REPAIR' where date<three_months_before_today

...having used some sort of simple loop to calculate the date three months prior.

If anyone could help that would be marvellous!

(if it makes things any easier, whole months would be fine, ie it's November now, delete all records prior to September)

Many thanks

;)
 
Basically, just use a DELETE query

i.e.

DELETE *
FROM MyTable
WHERE MyField Between DateAdd("m",-3,Date()) And Date();

where MyTable is your table and MyField (of course) is the field with the date.
 
course it is! ha ha! ahem.

lol :D

I know that that query seems very SQL based, but this App. is running from small tables on her PC. Will tat make a difference?


Thanks again!
 
It shouldn't make any difference.

Afterall, Access queries are SQL.

You can switch back and forth between Design view, datasheet view, and SQL view in the query design section.
 
oh, there was one more... where would the query sit inside the access page?

With php I've always coded the whole lot by hand, so the GUI involved with microsoft's stuff is just confusing me at the moment. Despite that, I'm really not in the mood to start on VBScripting yet- I'm still coming to grips with XHTML, UML, XML, DHTML, ActionScript, PHP, MySQL.......


Ha Ha!

:confused:
 
Ah! You are using data access pages - I'm sorry, but I've never used them myself. Just never had the need. :(
 
s'all good, mate... thanks for your time anyway!

:)
 

Users who are viewing this thread

Back
Top Bottom