Select from actlog (last 24 hours from current)

Rhuobhe

ADSM.ORG Member
Joined
Feb 18, 2010
Messages
94
Reaction score
1
Points
0
SELECT date_time,message FROM actlog WHERE message LIKE'ANR2578W%' OR message LIKE'ANR2579E%' AND date_time>current_timestamp-24 hours

Hi I'm trying to write a simple select that pulls missed and failed messages from the past 24 hours from the current time stamp.

I am using the select above but it is still pulling data from the past 30 days please let me know what is the correct way to end the select so that it only shows me the past 24 hours from the current time stamp. Thank you
 
Also tried:


SELECT date_time,message FROM actlog WHERE message LIKE'ANR2578W%' OR message LIKE'ANR2579E%' AND date_time<=current_timestamp-1 days
 
A couple of things. Wrong > symbol. Think of alligators in 2nd grade :). And instead of using LIKE which can be tricky, just use MSGNO=####. And it's easier to break things in brackets.


Try this:
SQL:
SELECT date_time,message FROM actlog WHERE date_time>=(current_timestamp-1 days) and (msgno=1699 or msgno=8592)
 
Back
Top