J
J-P-W
Hi,
I have a system that records insurance policies.
If the policy is cancelled then any part of a month insured is deducted
from the premium, so a policy that ran for 32 days would get a 10 month
rebate so would 58 days etc.
I've used:
TheStartDate = "2006-06-15" 'changed manually for now, usually ......
rsuser("PolicyStart")
DaysSinceInception = DateDiff("d",TheStartDate,Date)
MonthsSinceInception = DateDiff("m",TheStartDate,Date)
response.Write("Policy Start = " & TheStartDate & "<br>")
response.Write("Today = " & date & "<br>")
response.Write("Days Since Inception = " & DaysSinceInception & "<br>")
response.Write("Months Since Inception = " & MonthsSinceInception &
"<br>")
Example of results (Date is in UK format):
Policy Start = 2006-06-01
Today = 14/07/2006
Days Since Inception = 43
Months Since Inception = 1
Policy Start = 2006-06-11
Today = 14/07/2006
Days Since Inception = 33
Months Since Inception = 1
Policy Start = 2006-06-13
Today = 14/07/2006
Days Since Inception = 31
Months Since Inception = 1
Policy Start = 2006-06-15
Today = 14/07/2006
Days Since Inception = 29
Months Since Inception = 1
Policy Start = 2006-06-30
Today = 14/07/2006
Days Since Inception = 14
Months Since Inception = 1
~~~~~~~~~~~
Can anyone please help me to 'round up' the month?
In antipation, thank you
Jon
I have a system that records insurance policies.
If the policy is cancelled then any part of a month insured is deducted
from the premium, so a policy that ran for 32 days would get a 10 month
rebate so would 58 days etc.
I've used:
TheStartDate = "2006-06-15" 'changed manually for now, usually ......
rsuser("PolicyStart")
DaysSinceInception = DateDiff("d",TheStartDate,Date)
MonthsSinceInception = DateDiff("m",TheStartDate,Date)
response.Write("Policy Start = " & TheStartDate & "<br>")
response.Write("Today = " & date & "<br>")
response.Write("Days Since Inception = " & DaysSinceInception & "<br>")
response.Write("Months Since Inception = " & MonthsSinceInception &
"<br>")
Example of results (Date is in UK format):
Policy Start = 2006-06-01
Today = 14/07/2006
Days Since Inception = 43
Months Since Inception = 1
Policy Start = 2006-06-11
Today = 14/07/2006
Days Since Inception = 33
Months Since Inception = 1
Policy Start = 2006-06-13
Today = 14/07/2006
Days Since Inception = 31
Months Since Inception = 1
Policy Start = 2006-06-15
Today = 14/07/2006
Days Since Inception = 29
Months Since Inception = 1
Policy Start = 2006-06-30
Today = 14/07/2006
Days Since Inception = 14
Months Since Inception = 1
~~~~~~~~~~~
Can anyone please help me to 'round up' the month?
In antipation, thank you
Jon