Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculating difference from total in previous row

Status
Not open for further replies.

kwj1027

IS-IT--Management
Aug 10, 2004
28
0
0
US
I am calculating the number of seconds since midnight to a date/time in a row.

I need to subtract the previous row entry from the current row to determine the amount of time (seconds) between the two rows.

Hopefully this is descriptive enough to describe the needed solution.

Regards
 
Hey,

Are you looking for something like:

if PreviousIsNull({Table.DateField}) then 0 else
datediff('s', Previous({Table.DateField}),{Table.DateField})


Poul
 
When I try the formula:

if PreviousIsNull({F57041.Q1TDTE}) then 0 else
datediff('s', Previous({{F57041.Q1TDTE}}),{{F57041.Q1TDTE}})


I get an error on the Previous field name as not being known?

regards
 
If this is an exact copy/paste, then you've got extra sets of French Braces (affectionately known as 'squigglies') around your field names.
Should be:
Code:
if PreviousIsNull({F57041.Q1TDTE}) then 0 else
    datediff('s', Previous({F57041.Q1TDTE}),{F57041.Q1TDTE})


Bob Suruncle
 
Amazing how a typo can mess one up! That seems to do exactly what I need.

Thank you for your assistance!

Regards~ Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top