I currently use this SQL in a query to calculate how many years a
member has served.
IIF(DateDiff("yyyy", qryMemberClubHistoryActive.DateJoinedThisClub,
Now()) < 1, "Joined this year", DateDiff("yyyy",
qryMemberClubHistoryActive.DateJoinedThisClub, Now()) & " years")
Of course in the case of '1 year' it is shown as "1 years".
I attempted to separate the single year and failed:
IIF(DateDiff("yyyy", qryMemberClubHistoryActive.DateJoinedThisClub,
Now()) < 1, "Joined this year", (IIF(DateDiff("yyyy",
qryMemberClubHistoryActive.DateJoinedThisClub, Now()) =
1,DateDiff("yyyy", qryMemberClubHistoryActive.DateJoinedThisClub,
Now()) & " year", qryMemberClubHistoryActive.DateJoinedThisClub,
Now()) & " years")
What have I missed?
Many thanks,
Robin Chapple
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar