difference between two dates

hi all,

i want to fine the difference between 2 days

for eg, OrderDate(1/1/2012) and Today(9/2/2012),

the diff date is 40 days…

pls help me …

thanx in advance :slight_smile:

Hi Arun,

Try this way:

StartDate := 010104D;
CloseDate := 310104D;
info('Days: %1', CloseDate - StartDate); // 30 Days

If you simply subtract one date from another, you will get the number of days in difference..


to get the difference between two dates date1 and date2…

date2num(date2) - date2num(date1)

its simple…

sorry dear, getting error…

hi dude,

just try this, i don’t know y the error is coming…

static void Job23(Args _args)
int i;
date1980 date1, date2;

date1 = mkdate(01,01,2012);
date2 = mkdate(01,02,2012);
i = date2num(date2) - date2num(date1);


thanx all…