PDA

View Full Version : Date Calculatiions


ABC123

gleason.will
03-09-2014, 01:28 PM
I am attempting to write a function to calculate the duration Dur (N) between 2 dates (D). Dur = {end_date} - {start_date}. It all seems to be pretty simple and works as a calculated field in the desktop version. For some reason I can't get it to run in the Webapp. I get N.... gibberish instead of a number. Obviously doing something wrong... Any suggestions.

Will

Ted Giles
03-09-2014, 02:48 PM
Post your code.

gleason.will
03-09-2014, 06:26 PM
I am attempting to write a function to calculate the duration Dur (N) between 2 dates (D). Dur = {end_date} - {start_date}. It all seems to be pretty simple and works as a calculated field in the desktop version. For some reason I can't get it to run in the Webapp. I get N.... gibberish instead of a number. Obviously doing something wrong... Any suggestions.

Will

DIM Dur as N
DIM finish_date as D
DIM start_date as D
finish_Date = {06/01/2014}
start_date = {06/15/2014}
dur = finish_date - start_date

GGandhi
03-09-2014, 09:32 PM
I get N.... gibberish
if you get NaN then it is a javascript function you are writing and the javascript does not know what to do.
but what you are writing is xbasic.
so where is the code placed?
in a grid or a dialog?
what makes the code run?
these decide how this is implemented.
then you can write the code in that area using xbasic and get that done.