Audit Trail: All Changes by Date
###
Auditing
###
34200/Any rev01
###
All add, change and delete actions between two dates, grouped by user.
###
en
###
SELECT AuditDate, UserName, TableName, LinkID, Description,
CASE WHEN Action = 0 THEN 'ADD'
WHEN Action = 1 THEN 'EDIT'
WHEN Action = 2 THEN 'DELETE'
WHEN Action = 3 THEN 'MOVE'
END AS Action
FROM audittrail
WHERE
AuditDate >= '$ASK DATE Enter the from date$' AND AuditDate <= '$ASK DATE Enter the to date$ 23:59:59'
AND Action IN (0,1,2,3)
ORDER BY UserName, AuditDate
###
$$HEADER
HEADER$$

$$GROUP_UserName
$$HEAD
<h2>$UserName</h2>
<table>
<tr>
<td><b>Date</b></td>
<td><b>Action</b></td>
<td><b>Table</b></td>
<td><b>ID</b></td>
<td></td>
</tr>
$$FOOT
</table>
GROUP$$

$$BODY
<tr>
<td>$AUDITDATE</td>
<td>$ACTION</td>
<td>$TABLENAME</td>
<td>$LINKID</td>
<td>$DESCRIPTION</td>
</tr>
BODY$$

$$FOOTER
FOOTER$$
