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!

Help on doing difference of dates with prev row.

Status
Not open for further replies.

vega83

Programmer
Jun 12, 2008
141
0
0
US
Friends I have data like below

TICK: user time
A1 D1 12/30/2009
A1 D2 12/31//2009
A1 D2 01/01/2010

A3 D1 01/01/2010
A3 D2 01/02/2010
A3 D2 01/03/2010

I wold like to do date diff with prev colum and want to display data like below

TICK: user time datediff
A1 D1 12/30/2009 0
A1 D2 12/31//2009 1
A1 D2 01/01/2010 1

A3 D1 01/01/2010 0
A3 D2 01/02/2010 1
A3 D2 01/04/2010 2

Any help on this?
Thanks,
Vega
 
if onfirstrecord or
{table.tick} <> previous({table.tick}) then
0 else
datediff("d",previous({table.date}),{table.date})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top