Brad
"Roman Kastin" <roman DOT kastin AT gsa.gov> wrote in message
news:51f9f2p6jcnd6kl6q...@4ax.com...
number of years = Year(Date2) = Year(Date1)
number of months = Month(Date2) - Month(Date1) + (number of years * 12)
For days, it's more difficult. If the day of Date2 > day of Date1, you can
just use:
number of days = Day(Date2) - Day(Date1)
For example, 6/17/06 as the first date and 8/28/06 as the second date, you
would get
2 months and 11 days.
But, when you have 6/28/06 and 8/17/06, how do you want to figure out the
number of days? You could do:
(last day of the month of the first date - day of the month of the first
date) + day of the month of the second date
So, in our example you'd get 1 month and 19 days.
if number of days < 0 then
number of months -= 1
number of days = (last day of month - Day (Date1)) + Day (Date2)
end
For the last day of month, you would need to take into account which month
and for February account for leap years.
If you wanted to use the n_cst_datetime object in the PFC, you have the
functions of_LastDayOfMonth() and of_MonthsAfter() to do some of the
calculations above.
HTH,
steve
[TeamSybase]
"Roman Kastin" <roman DOT kastin AT gsa.gov> wrote in message
news:51f9f2p6jcnd6kl6q...@4ax.com...
steve
[TeamSybase]
"Brad Wery [TeamSybase]" <bradweryatagricoreunited.com> wrote in message
news:44f4f0ad@forums-2-dub...
"Roman Kastin" <roman DOT kastin AT gsa.gov> wrote in message
news:51f9f2p6jcnd6kl6q...@4ax.com...
Roman
On 29 Aug 2006 19:28:33 -0700, "Steve Katz [TeamSybase]"
"Steve Katz [TeamSybase]" <steve...@teamsybase.com> wrote in message
news:44f4f8c4$1@forums-1-dub...
"Brad Wery [TeamSybase]" <bradweryatagricoreunited.com> wrote in message
news:44f5d043@forums-1-dub...
"Ken Balakrishnan" <kNOe...@cps92.com> wrote in message
news:44f60638@forums-2-dub...
S'ok.....been there, done that, too.
The penalty, btw, is one week without being allowed to sign with
[TeamSybase] in our name.<g>
steve
[TeamSybase]
"Brad Wery [TeamSybase]" <bradweryatagricoreunited.com> wrote in message
news:44f5d043@forums-1-dub...