You post nothing about the layout of the report, or where your formula is or where the sum is supposed to be displayed, so we have to guess, please take the time to think your posts through and provide basic information.
Modify your formula to:
whileprintingrecords;
numbervar MyTotal;
if not(PreviousIsNull({F57041.Q1TDTE})) then
MyTotal:=MyTotal+datediff('s', Previous({F57041.Q1TDTE}),{F57041.Q1TDTE});
if PreviousIsNull({F57041.Q1TDTE}) then 0 else
datediff('s', Previous({F57041.Q1TDTE}),{F57041.Q1TDTE})
Then you can display the sum in the report footer, as in:
whileprintingrecords;
numbervar MyTotal
If it's in a group that you need the total, display in the group footer and you'll need a reset for the variable in the group header, as in:
whileprintingrecords;
numbervar MyTotal:=0
As you can see you force us to start guessing at what you have and what you need if you don't take a little time to describe what you have and where, and what you need.
You should also always post your software version and the database being used as there are often more efficient ways by leveraging the database.
-k