Data from Multiple Table in Audit Trail Browser

Hi,

One of our client is asking system events to be shown along with other evens in a single Audit Trail browser.

Please refer the images of two tables that am using.
Image 1 - Alarms and Audit Trails

image

Image 2 - System Events enabled through domain options
image
image

How do i combine data from both the tables and show it in a single browser.

Thanking you in advance.

Regards,
Suraj

Hi Suraj!

You can use the SQL UNION operator. For example:

SELECT E3TimeStamp, Message FROM Alarms
UNION
SELECT E3TimeStamp, EventMessage FROM Events
ORDER BY E3TimeStamp ASC

Hi Paulo,

Thanks a lot for your suggestions.
E3timestamp and messages has been combined, but the issue is I am unable to filter it as per the required timeframe, it is showing all the data since the modifications have been done related to union of particular columns from two tables.

Please suggest.

Regards,
Suraj

SELECT E3TimeStamp, Message FROM Alarms
WHERE E3TimeStamp >= #<%InitialDate%># AND E3TimeStamp <= #<%FinalDate%>#
UNION
SELECT E3TimeStamp, EventMessage FROM Events
WHERE E3TimeStamp >= #<%InitialDate%># AND E3TimeStamp <= #<%FinalDate%>#
ORDER BY E3TimeStamp ASC