Using date special functions with datafields

Does this function work with a datafield: @year-of(#contract^date)?

I receive an error-notification because the datafield is undefined, but it doesn’t appear on my datafields page, so I can’t assign a value. How can I fix this?

Thanks in advance!