janice
07-29-2003, 08:33 AM
good friends, I have a little problem.
I have 3 dates: trainingDate, firstDate, 2ndDate.
I want to determine the least date of the 3 and add one year to it and call it expirationDate.
For instance, trainingDate = 01/01/2003, firstDate, 02/01/2003, and 2ndDate = 03/01/2003.
Here, the least is trainingDate.
I need to take this trainingDate and add one year to it.
Here is my code:
thanks in advance
if dateDiff("d", trainingDate, secondDate)<0 then
'a negative value from datediff means the first value is later than the second
if dateDiff("d",secondDate,thirdDate)<0 then
thirdDate=DateAdd("yyyy",1,thirdDate)
response.write thirdDate
else
secondDate=DateAdd("yyyy",1,secondDate)
response.write secondDate
end if
else
if dateDiff("d",trainingDate,thirdDate)<0 then
thirdDate=DateAdd("yyyy",1,thirdDate)
else
trainingDate=DateAdd("yyyy",1,trainingDate)
response.write secondDate
end if
end if
I have 3 dates: trainingDate, firstDate, 2ndDate.
I want to determine the least date of the 3 and add one year to it and call it expirationDate.
For instance, trainingDate = 01/01/2003, firstDate, 02/01/2003, and 2ndDate = 03/01/2003.
Here, the least is trainingDate.
I need to take this trainingDate and add one year to it.
Here is my code:
thanks in advance
if dateDiff("d", trainingDate, secondDate)<0 then
'a negative value from datediff means the first value is later than the second
if dateDiff("d",secondDate,thirdDate)<0 then
thirdDate=DateAdd("yyyy",1,thirdDate)
response.write thirdDate
else
secondDate=DateAdd("yyyy",1,secondDate)
response.write secondDate
end if
else
if dateDiff("d",trainingDate,thirdDate)<0 then
thirdDate=DateAdd("yyyy",1,thirdDate)
else
trainingDate=DateAdd("yyyy",1,trainingDate)
response.write secondDate
end if
end if