Re: help with sql
2001-12-20 13:43:13
>Hi TSMers,
>
>Can someone help me with with the following. I am trying to select from the
>actlog all entries for a client in the past 7 hours and send them to the user
>in a daily report. I may not be doing the sql select right. Nothing is
>selected even though the client just did a backup.
>
>=> cat a.mac
>set sqldisplaymode wide
>select date_time, message from actlog where nodename='VTCAT.CC.VT.EDU' and tim
>e(actlog.date_time) >= current time - 7 hours
>
>
I'm not an SQL expert but I've been experimenting with similar statements
myself and would suggest :
select date_time, message from actlog where nodename='VTCAT.CC.VT.EDU' and
date_time>=current_timestamp - 7 hours
or
select date(date_time) as date, time(date_time) as time,message from actlog
where date_time>=current_timestamp - 7 hours and nodename='VTCAT.CC.VT.EDU'
+----------------------------------------------------------------------+
Steven Bridge Systems Group, Information Systems, EISD
University College London
email: s.bridge AT ucl.ac DOT uk tel: +44 (0)20 7679 2794
|
|
|