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

Help with Function to condense records

Status
Not open for further replies.

adventurous1

Programmer
Mar 5, 2004
64
US
Oh boy...here's the latest problem for the access newbie.

My dataset has records that look like this:

Field RecordID Created User OldValue NewValue
status 6789 3/1/10 1:25:30 AM SVACS In Prog
status 6789 3/1/10 1:25:30 AM SVACS Accepted
status 6789 2/15/10 8:30:30 PM SVACS Reopened
status 6789 2/15/10 8:30:30 PM SVACS Closed
status 5211 1/5/10 7:30:30 AM KHOS Closed
status 5211 1/5/10 7:30:30 AM KHOS Verified


And I need to transform the result to look like this:

Field RecordID Created User OldValue NewValue
status 6789 3/1/10 1:25:30 AM SVACS Accepted In Prog
status 5211 1/5/10 7:30:30 AM KHOS Verified Closed

Can anyone help me by posting an Access function that will do this transformation?

Thanks!

 
Not sure I understand. What do you mean specifications and rules?

I essentially need to condense multiple records with the same date/time but different old & new values to a single record for a given RecordId.

Thanks.
 
Only the data for the most recent date/timestamp should be returned. Older records should not be returned as part of the results.
 
Correction...!

Only the data for the most recent RecordID and date/timestamp should be returned. Older records for a RecordID should not be returned as part of the results.
 
adventurous1 said:
What do you mean specifications and rules?
You seem to have found them. Are the specifications stable now? If so, I think you want to start by creating a totals query of the Field and RecordID with the max of Created. Then join this query to the orginal dataset and again make it a totals query with max of OldValue and NewValue.

Duane
Hook'D on Access
MS Access MVP
 
Thanks...I will try that. One question though...Isnt a function more efficient?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top