Expand|Select|Wrap|Line Numbers
- SELECT A.USERNAME
- , A.ALARMDATE
- , Mid(A.ALARMDETAILS,(InStr(1,A.ALARMDETAILS,"User",1)+4),(InStr(InStr(1,A.ALARMDETAILS,"User",1),A.ALARMDETAILS,"(",1))-(InStr(1,A.ALARMDETAILS,"User",1)+4)) AS SC
- FROM alarmManfASQueryA AS A, Employees AS E
- WHERE (((A.USERNAME) Not Like '')
- AND ((A.ALARMDATE) In (SELECT Max(B.ALARMDATE) FROM alarm AS B where (A.USERNAME = B.USERNAME) GROUP BY B.USERNAME)
- And (A.ALARMDATE)>=DateSerial(Year(Date()),Month(Date()),Day(Date())-240)) AND ((A.ALARMDETAILS) Like "*Access Granted*"));
The selected field "SC", is the key field required in further codings, its simply getting a number from A.ALARMDETAILS with below example.
Expand|Select|Wrap|Line Numbers
- Chall 1 (XXX) Access Granted with Region: Section 17 (Exit), Region 1 (region 1) (Jackie Chan, User 218)
Anyone can help would greatly appreciate. Thanks.
Update: I spend an hour time waiting to its completion, and yes the result appears 1 hour later. But this shouldn't be the time taken for this result, and Access crashed up when I tried to scroll down the list...