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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date difference between rows

Status
Not open for further replies.

anglophobe

Technical User
Nov 27, 2006
11
CA
I need to find the date difference between two different rows of data.

MY data is set up like this:

ID# Old New Date
101 A B 15/01/01
101 B C 16/01/01
102 A B 17/01/01
103 B C 17/01/01

And I would need to find the difference between the time when B is new and when B is old, for each ID#.

I'm using CR10, with no ODBC access, just an access db plugged into crystal.

Thanks
 
Create a formula of:

if previous({table.id} = {table.id}
and
previous({table.new}) = "B"
and
{table.Old} = "B" then
{table.date}-previous({table.date})

You stated that you want the difference in time, but not how to represent it, I assumed here that you want it in days.

If you require further assistance, please state specifics about what you want and where.

-k

 
Sorry, the time will probably be in minutes or hours, I just removed that portion for simplicities sake.

One question in regards to the formula, is that the rows won't necessarily be in order, meaning it might have gone
101
103
102
101
.
.
.
etc.
The result will end up in a row with the id#

Thanks
 
Why not sort the rows in the proper order, or even group them?

As for displaying the time in minutes or hours, again, be specific.

Not sure why you don't want to take the time to post your actual data and requirements.

Here's my FAQ that might help with the output:

faq767-3543

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top