I have 2 fields in a report that allows me to script fields with VB. The fields come from SQL which are calulated like this:
Years:
DATEDIFF(MONTH,EFFECTIVEDATE, ISNULL(ENDDATE,GETDATE())) / 12
Months:
DATEDIFF(MONTH,EFFECTIVEDATE,ISNULL(ENDDATE,GETDATE())) % 12
What I am getting in the report is this situation:
John Smith
Years: 5
Months: 4
Years: 2
Months: 11
Sum fields: 7 years, 15 months
What I would really like to do and don't know how to manage this in vbscript, is to check the months field and update the years accordingly.
Years:
DATEDIFF(MONTH,EFFECTIVEDATE, ISNULL(ENDDATE,GETDATE())) / 12
Months:
DATEDIFF(MONTH,EFFECTIVEDATE,ISNULL(ENDDATE,GETDATE())) % 12
What I am getting in the report is this situation:
John Smith
Years: 5
Months: 4
Years: 2
Months: 11
Sum fields: 7 years, 15 months
What I would really like to do and don't know how to manage this in vbscript, is to check the months field and update the years accordingly.