This code checks when the FormInserted is not empty then delete the records from the ContactUs form.
I want to change it and to do it when the FormInserted(date) is greater than on year then to delete the records from the ContactUs form.
ObjectQuery<BizFormItem> data = BizFormItemProvider.GetItems(formClassName).WhereNotEmpty("FormInserted");
Then you'd update your where clause to something like this:
.Where("FormInserted < DATEADD(day, -365, GETDATE())")
Please, sign in to be able to submit a new answer.