Delete document after 30 days

HiI want to delete document in a folder when the are older then 30 days. I use agent for this and selct the folder under Document selection and put this in Action. What did i miss or should a do it some other way.

SELECT @If((@Now-DeliveredDate>=30);@DeleteDocument;“”)

Kind regards

Fredrik

Subject: Delete document after 30 days…

@Now - DeliveredDate returns the difference in seconds so to convert to days you need to divide the result by 86400 or use the @Adjust function instead.

Subject: Delete document after 30 days…

First thing: you mixed selection formula with the command.Second thing: I am not sure but I suppose the time/date difference goes in seconds. So you should use 30*86400 as your difference.

I would do it this way:

SELECT @All;

@If(@Now-DeliveredDate>=(30*86400);@DeleteDocument;“”)

But better first test it, I didn’t …