I'm trying to display the number of failed attempts in the past 24hrs, where 'created' is the date and time field (25-OCT-06 AM) and 'event' is the attempt type.

I need your help in the following query:

select distinct s.id, initcap(name) Name, to_char(a.created,'DD-Mon-YY hh24:mi:ss') Created
from companies s, dg_companyprops c,
(SELECT companyid, max(created) created
WHERE event IN ('User not found', '%Failed%', 'Incorrect Password')
AND created >= SYSDATE - 2
group by companyid) a
where s.id = a.companyid (+)
and s.id = c.id
and (a.created <= sysdate - 1 or a.created is null)
order by 1;

**The created date displays nothing, partly because of the condition 'or a.created is null'. How can I get it to display the correct created date and time in the pst 24hrs?

Thx in advance for your help!