Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@Adjust bugging me

Status
Not open for further replies.

gbayccni

IS-IT--Management
Jun 5, 2003
4
FR
Hi all,

I have a field 'Date_B'(a time/date field) with the following formula:
@Adjust(Date_A;3;0;0;0;0;0)

It takes the date from Date_A field and increments the year.
I have no compile problems. However when I come to test the form I get the error:
Field:Date_B: incorrect data type for operator or @function: Time/Date expected.

Notes help says to do it like this !!!. The only way I can stop the error is: @Adjust(@Now;3;0;0;0;0;0)

But that's not want I want to do. I simply want the Date_B field to be 3 years ahead of Date_A field.

Any ideas - this is really bugging me now

Thanks,
ian
 
This might sound like an obvious question but is field Date_A a Time/Date field? If it's not you will get this error.

It looks like, from your information that Date_A might be a text field. The value taken from it will be text and cannot be used in the @Adjust formula as a date value is expected.

So, make sure Date_A is a time/date field. I would also put @Today as the default value in this field. This way, the formula in Date_B is not working with a null value if Date_A is empty.

If this does not help out please supply information on the field type of Date_A

Good luck!
 
Hi,

Date_A field is Type: Date/Time, editable.
Date_B field is also Date/Time - I have tried computed and editable.

Date_A field is filled in with any date (ie when a test was taken). I want Date_B field to be 3 years ahead (ie when the test is due for re-testing). So if Date_A field was 01/01/2003 Date_B field has to be 01/01/2006.

As soon as I use the function @Adjust(Date_A..... I get the error when testing the form referring to Date_B field. I do not get any compile errors though.

If I use @Adjust(@Now etc no problem - but this means the whole idea fails.
When I checked in Notes Help - it says to do it like this @Adjust(field;....

So what's wrong ?

Thanks,
Ian
 
Got it...you hit the nail on the head with null value.:~/

Date_A had null value - so I changed this to @Today - it's just a matter of refreshing fields if I change date in Date_A.

Thanks for you help.
Ian [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top