Track changes using query (1 Viewer)

kapaw

Registered User.
Local time
Today, 06:26
Joined
Mar 30, 2011
Messages
30
Hi, I am stuck with this tracking problem, here is an example:
Log Table
A B C D E
Apple W.Apple Approved Not Approved 7/19/2011
Apple W.Apple Approved Approved 7/4/2011
Apple G.Apple Approved Approved 7/4/2011
Apple X.Apple Approved Approved 7/4/2011
Apple X.Apple Not Approved Approved 7/1/2011

I want a query that will output this:
Changes:
A B C D E
Apple W.Apple Approved Not Approved 7/19/2011
Apple W.Apple Approved Approved 7/4/2011
Apple X.Apple Approved Approved 7/4/2011
Apple X.Apple Not Approved Approved 7/1/2011

In short, it will only output the data that has changed there value in either C or D. Is this query related or should I use something else?
 

GinaWhipp

AWF VIP
Local time
Today, 09:26
Joined
Jun 21, 2011
Messages
5,899
How will the query know what is changed? Is there alwaus two lines if it's been changed?

Also, is this an Access table? Odd names for field names...
 

kapaw

Registered User.
Local time
Today, 06:26
Joined
Mar 30, 2011
Messages
30
That table is just a sample, :). It can also be just one line for the result, but highlight the filed that was changed. The Log table comes from multiple spreadsheets which is updated every week. So I need a query the will tell me if col A and B has any changes on their col C or D. Here's a good example of my table, I want a query that will inform me that Part No 101 Status has been changed from Approved to Obsolete. This changes can happen to a multiple lists of Board and Part No.
Board Part No
Part Type Description Phase Status Checked 20a 100 Components
blah blah Approved
Approved 6/21/2011 20a 101 Components
blah blah Approved Obsolete 7/11/2011 20a 101 Components
blah blah Approved Approved 6/21/2011 20a 102
Components
blah blah Approved
Approved 7/11/2011 20b 102 Components
blah blah Approved Approved 6/21/2011 20b 103 Components (CE) blah blah
Approved Approved 6/21/2011
 

GinaWhipp

AWF VIP
Local time
Today, 09:26
Joined
Jun 21, 2011
Messages
5,899
I think you misunderstood my question... Not how do you (or even I) know, how will the query know? In that. there was to be some sort of tag, some way to set criteria for the query to know. Examples, would be Date/Time Stamp field, always two records, Yes/No field when a record is changed...

See what I mean?
 

kapaw

Registered User.
Local time
Today, 06:26
Joined
Mar 30, 2011
Messages
30
The date stamp and also the Approved/Unapproved column. Did I answer your question? I'm still a newbie with access.
 

GinaWhipp

AWF VIP
Local time
Today, 09:26
Joined
Jun 21, 2011
Messages
5,899
Okay what is the criteria? Like if Date Stamp column equal what AND Approved/Unapporved equal False?
 

kapaw

Registered User.
Local time
Today, 06:26
Joined
Mar 30, 2011
Messages
30
Sample:
Board_____Part no____Timestamp______Description____Status
abc_______123_______7/1/2011_______description____Approved
abc________123_______6/1/2011______...ROHS______Approved
def_______456_______7/1/2011_______...ROHS_____Unapproved
def________456_______6/1/2011______...ROHS_____Approved

For Board "def" part no. "456", maybe if datestamp of def456 first record < datestamp of def456 newer record AND Status is not equal OR Description change=True? Is that possible?
 

B.Ozturk

New member
Local time
Today, 16:26
Joined
Jul 21, 2011
Messages
6
Hi;
If I understood your question correctly, try it;

Code:
Select a.board, a.PartNo, a.TimeStamp, a.Description,a.Status
From Your_Table_name AS a
Where exist 
             (select last(board)
             from Your_Table_name 
             where 
                    board=a.board
                    and PartNo=a.PartNo 
                    and TimeStamp=a.TimeStamp
                    and Description<>a.Description
                    and Status<>a.Status)
 

kapaw

Registered User.
Local time
Today, 06:26
Joined
Mar 30, 2011
Messages
30
This is perfect! Thanks a lot Ozturk!! I just changed
and TimeStamp=a.TimeStamp to and TimeStamp<>a.TimeStamp
 

Users who are viewing this thread

Top Bottom