Thanks but I have to get something like :
2M --> 60
45D --> 45
2Y --> 720
....................
Can you tel me how can I deal with that?
as the post above describes - you're going to have problems with 2M since not all months are 30 days. If you need it to be 60 days you'll need to code that to 60 & 2Y = 730 not 720.
You need to apply the formula to today's date, and then do the calculation
new date - today's
This will give you an integer, but as you've been advised you won't get 60 days when using 2M, it depends on the number of days of that particular month...
Comments
You can convert a datetime like a "delta" integer:
something like:
i := calcdate('<1M>', today) - today
But if the calculation involve month, for example, can return strange result:
If today is 22 of may, + 1 Month the int result is 31 days.
But if today is 22 Feb. + 1 Month the int result is 28 days.
Bye
Matteo
2M --> 60
45D --> 45
2Y --> 720
....................
Can you tel me how can I deal with that?
Hanen TALBI
as the post above describes - you're going to have problems with 2M since not all months are 30 days. If you need it to be 60 days you'll need to code that to 60 & 2Y = 730 not 720.
http://www.BiloBeauty.com
http://www.autismspeaks.org
new date - today's
This will give you an integer, but as you've been advised you won't get 60 days when using 2M, it depends on the number of days of that particular month...