Using Access 2003 in 2000 format
Fields include YearJoined (actually this is a complete date and would more properly be named DateJoined), DateDeceased, DateResigned.
I want to be able to calculate the difference in years between the YearJoined and the Current Date, providing there is no DateDeceased. This gives that to me...
I can also get the difference in years between the YearJoined and the Current Date, providing there is not ResignedDate. This gives that to me...
How do I put those IIf statements together so that...
If there is both no DeceasedDate AND no ResignedDate, I get the years between YearJoined and the Current Date?
Thanks.
Tom
Fields include YearJoined (actually this is a complete date and would more properly be named DateJoined), DateDeceased, DateResigned.
I want to be able to calculate the difference in years between the YearJoined and the Current Date, providing there is no DateDeceased. This gives that to me...
Code:
IIf(IsNull([DeceasedDate]),DateDiff("yyyy",[YearJoined],Date())+Int(Format(Date(),"mmdd")<Format([YearJoined],"mmdd")),DateDiff("yyyy",[YearJoined],[DeceasedDate]+Int(Format([DeceasedDate],"mmdd")<Format([YearJoined],"mmdd"))))
I can also get the difference in years between the YearJoined and the Current Date, providing there is not ResignedDate. This gives that to me...
Code:
IIf(IsNull([ResignedDate]),DateDiff("yyyy",[YearJoined],Date())+Int(Format(Date(),"mmdd")<Format([YearJoined],"mmdd")),DateDiff("yyyy",[YearJoined],(Date())+Int(Format([ResignedDate],"mmdd")<Format([YearJoined],"mmdd"))))
How do I put those IIf statements together so that...
If there is both no DeceasedDate AND no ResignedDate, I get the years between YearJoined and the Current Date?
Thanks.
Tom