What you intend to do can be likened to the attempt to store the result of an integer division in an integer. The result may be good, but it is more likely that it is not exact, and the error might range between neglectable to unacceptable.
The easiest way to get a duration in days is to apply the formula to just any date (somewhere in the middle of the range of valid dates), subtract the original date from the result and assign this difference to an integer.
He doesn't want 'number of days' he wants dateformula expressed as regular words.
You'll have to write your own functions to convert that. If you want an example of a structure find the check report, that has functions that translate numbers into words, so you can kind of use that as inspiration of how to program that.
What you intend to do can be likened to the attempt to store the result of an integer division in an integer. The result may be good, but it is more likely that it is not exact, and the error might range between neglectable to unacceptable.
The easiest way to get a duration in days is to apply the formula to just any date (somewhere in the middle of the range of valid dates), subtract the original date from the result and assign this difference to an integer.
^ This is exactly what I ended up doing. I needed to compare a duration field with a dateformula field.. hense the need to convert the dateformula into the appropriate type.
My code ended up like this:
duration := (CALCDATE(dateformula,WORKDATE) - WORKDATE);
If anyone can suggest a better way of doing this I'd love to hear it.
He doesn't want 'number of days' he wants dateformula expressed as regular words.
Oh, you're right. I read that but did not get it's meaning, so I ignored it. Now you told me, this explanatory remark in the original request makes sense.
The easiest way to get a duration in days is to apply the formula to just any date (somewhere in the middle of the range of valid dates), subtract the original date from the result and assign this difference to an integer.
Comments
Good point, I think more my purposes it is safe to assume a year is 365 and a month is 31 days.
The easiest way to get a duration in days is to apply the formula to just any date (somewhere in the middle of the range of valid dates), subtract the original date from the result and assign this difference to an integer.
You'll have to write your own functions to convert that. If you want an example of a structure find the check report, that has functions that translate numbers into words, so you can kind of use that as inspiration of how to program that.
RIS Plus, LLC
^ This is exactly what I ended up doing. I needed to compare a duration field with a dateformula field.. hense the need to convert the dateformula into the appropriate type.
My code ended up like this:
duration := (CALCDATE(dateformula,WORKDATE) - WORKDATE);
If anyone can suggest a better way of doing this I'd love to hear it.
Thanks,
Dan
On the other hand: :?