@Adjust

I am having a terrible time with adjusting a date field. I have a series of record storage numbers that require different retention periods, and I want the destruction date to be calculated at the time that expiration date is entered. Expiration date IS a time/date field, but it contains multiple values. I entered the code in both the form and in the view column, but neither worked - it shows as blank, not even an error. Can anyone tell me what I am doing wrong?

Here is my code:

@If(RecordStorageNumber = “2402”; @Adjust(ExpDate; 15; 0; 0; 0; 0; 0); “”);

@If(RecordStorageNumber = “2461(@AdjustExpDate; 2; 0; 0; 0; 0; 0):”")

etc.

Thanking you in advance.

Cathy

Subject: @Adjust

Is RecordStorageNumber a “number” field or is it stored as text? If it’s a number field then:

@If(RecordStorageNumber = 2402; …

quotes make it a text value. Also, are you trying to adjust the year ahead by 15 or 2 years? And, if the ExpDate field is multi-value the code will likely adjust all dates in the field, although I’ve not looked into it or tested to see if @Adjust will even work on a MV field, but logically it should.

Subject: RE: @Adjust

RecordStorageNumber is a text field, with four different possible values. Each of the four values has a different retention period, so for 2402 I’m trying to add 15 years to ExpirationDate, ExpDate is a time/date,multivalue. If the retention periodis for otherwise, I want to adjust by 2 years, or six years, etc.

I was wondering if I should be using some @Text or @TexttoNumber, but the Record Storage number isn’t really relevant to the formula, except as a reference point to adjust the Exp Date. Thanks for the response, Paul.

Subject: RE: @Adjust

if recordstroragenumber is test then your code should work but try this:

@If(RecordStorageNumber = “2402”; @Adjust(ExpDate; 15; 0; 0; 0; 0; 0); RecordStorageNumber = “2461”; @Adjust(ExpDate; 2; 0; 0; 0; 0; 0); ExpDate)

or this:

@If(@Contains(RecordStorageNumber; “2402”); @Adjust(ExpDate; 15; 0; 0; 0; 0; 0); @Contains(RecordStorageNumber; “2461”); @Adjust(ExpDate; 2; 0; 0; 0; 0; 0); ExpDate)

I hope I got the syntax correct. Let me know if either of those work.

Subject: @Adjust -

Paul, your first set of code works perfect, just what I needed. Sorry so long to respond back - got sent off on another project. Regards Cathy