These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Hi to everyone and a problem

Crease
Registered: Aug 24 2009
Posts: 4
Answered

Hi everybody,

i'm making a form which has date/time fields and a numeric field which calculate days between these two dates.I've read almost all the entries about formcalc /java script (date2num functions etc..) but i can't get this work.I even tried to copy and paste functions from given examples, all it gives non functioning fields with zero's or script errors.. I'm doing something wrong obviously but i'm lost..
Can someone show me the way?

That's what i do by the way: StartDate field with Date2num function EndDate field
with Date2num function.. Then a numeric/decimal field with subtraction of these two fields and /or start date field, (blank code)enddate field (blank code) and numeric/decimal field with a function:

(Date2Num(Date_2.formattedValue, "D/M/YY"))-(Date2Num(Date_1.formattedValue, "D/M/YY"))

All i see is zero.Help is much appreciated.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

use this FormCalc-Script in the calculation event of the numeric field, to display the difference of days.

Abs(Date2Num(Date_2.formattedValue, DateFmt(1)) - Date2Num(Date_1.formattedValue, DateFmt(1)))

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Crease
Registered: Aug 24 2009
Posts: 4
Great!.It worked.. Thank you.