Hi,
Create the formulas below
Frm1
datediff('n',{Table_Dates.ST_Date},{Table_Dates.EN_Date}) this will give you
31,-109 etc....
place this formula in details section then right click select format field then in common tab select suppress and click x+2 and enter the code below
left(cstr(datediff('n',{Table_Dates.ST_Date},{Table_Dates.EN_Date})),1) = '-'
Frm2
if left(cstr(datediff('n',{Table_Dates.ST_Date},{Table_Dates.EN_Date})),1) = '-' then
'***Error***'
this will give you error text ,Place this formula above the Frm1 formula in your details section
Now for Average.
Create Running Total ....
Select frm1 as Field to summarize
Evaluate
select formula and enter
left(cstr(datediff('n',{Table_Dates.ST_Date},{Table_Dates.EN_Date})),1) <> '-'
Reset
Select Never
Place the runningtotal in report footer
You will need to adjust the decimal palces hope you know how to do that
select the numeric field then format field and customize
Output
28/07/2008 17:57:00 28/07/2008 18:28:00 31
28/07/2008 19:59:00 28/07/2008 18:10:00 ***Error***
28/07/2008 17:57:00 28/07/2008 18:28:00 31
28/07/2008 18:08:00 28/07/2008 18:47:00 39
28/07/2008 18:11:00 28/07/2008 18:59:59 48
37
Cheers
Rahul
Cheers
Rahul
Edited by rahulwalawalkar - 15 Aug 2008 at 3:07am