Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have the following UNION query in MS Access:
SELECT DISTINCT "DOM " & mDOMExceptions.ExceptionID as ExceptionID, mDOMExceptions.[Status], mDOMExceptions.[Date Created], mDOMExceptions.LastUpdate, sDOMExceptionComments.Date, sDOMExceptionComments.User, sDOMExceptionComments.Location, sDOMExceptionComments.Comment
FROM mDOMExceptions INNER JOIN sDOMExceptionComments ON mDOMExceptions.ExceptionID = sDOMExceptionComments.ExceptionID
UNION
SELECT DISTINCT "WOM " & mWOMExceptions.ExceptionID as ExceptionID, mWOMExceptions.[Status], mWOMExceptions.[Date Created], mWOMExceptions.LastUpdate, SWOMExceptionComments.Date, sWOMExceptionComments.User, sWOMExceptionComments.Location, sWOMExceptionComments.Comment
FROM mWOMExceptions INNER JOIN sWOMExceptionComments ON mWOMExceptions.ExceptionID = sWOMExceptionComments.ExceptionID;I am trying to get a list of the "exceptions" but only showing their most recent comment.
When I run the query, I will get the following:
ExceptionID Status Date Created LastUpdate Date User Location Comment
WOM 52 Bring into Office 04.06.2009 04.06.2009 2:01:26 PM testUser1 Warehouse this item is missing its battery also
WOM 52 Bring into Office 04.06.2009 10.06.2009 2:24:11 PM testUser2 Office Please bring into office.

Great! Can you share the solution here so others can benefit from it? Please?
http://support.microsoft.com/default.aspx?scid=kb;en-us;555375
How to ask a question.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |