becks22
11th September 2008, 14:16
hi i need to print average funtion with dates ..
i mean i have to subtract 2 dates n then need to print its average

zardoz
11th September 2008, 14:44
Dates are long. You can do any integer operation on it:

avg.date = dat1 + ((dat2 - dat1) / 2) | to obtain the mean date, assuming dat2 >= dat1

becks22
12th September 2008, 07:17
Thanx sir ,,
Can i use it in print expression as i need to print their average

zardoz
12th September 2008, 13:24
The result is a long value that is a date.
You can use the expression in report field, obviously using the domain tcdate.

günther
12th September 2008, 15:25
avg.date = dat1 + ((dat2 - dat1) / 2) | to obtain the mean date, assuming dat2 >= dat1

Your calculation is okay, but the following one is easier and does not need the assumption:

avg.date = (dat1 + dat2) / 2

Günther