ADSM-L

Re: select * from events - only today's events

2001-12-28 11:34:56
Subject: Re: select * from events - only today's events
From: Mark Bertrand <Mark.Bertrand AT USUNWIRED DOT COM>
Date: Fri, 28 Dec 2001 10:25:35 -0600
Andy and all,

Your suggestion worked great!!(select * from events where scheduled_start
between '2001-02-20 00:00:00' and '2001-02-22 23:59:59'). I am using the
ODBC to return the information to an Excel spreadsheet. Where as before I
was getting just today's info, now the results look just like a query event
* * begindate=today-1 does in TSM.

The problem is, I do not want to update my Microsoft Query manually with
today and yesterday's actual date everyday to get those results.

Isn't there a way to use a "today-1" or something like, or for any of you
macro types out there, can I make Excel update my MS Query statement
automatically with the current dates.

I am providing my MS Query statement for your review.
I hope I have explained myself correctly, I often know what I want to do but
have a hard time relaying it verbally.

SELECT EVENTS.SCHEDULED_START, EVENTS.ACTUAL_START, EVENTS.DOMAIN_NAME,
EVENTS.SCHEDULE_NAME, EVENTS.NODE_NAME, EVENTS.STATUS, EVENTS.RESULT,
EVENTS.REASON FROM EVENTS EVENTS WHERE (EVENTS.SCHEDULED_START between
{'2001-12-27 07:00:00' and '2001-12-28 23:59:59'})ORDER BY EVENTS.NODE_NAME

Thanks to all.
Mark

>>An APAR was opened a while ago on this. The APAR number is IC28825, and is
has been closed as SUG (suggestion). Rather than re-write an explanation
myself, I will just quote from the APAR closing text:

==================== The EVENTS table is not an actual physical table. The
events are calculated from values in other tables. The server is able to
calculate events for past events where it no longer has an event record and
for future events. Future events are accessible with QUERY EVENT but not
with SELECT from EVENTS. Since the events are unbounded, the default is to
only give the events from the current day. You can select events in a date
range using: select * from events where scheduled_start between '2001-02-20
00:00:00' and '2001-02-22 23:59:59' ====================

While I'm sure it is possible to have SELECT from the EVENTS table work more
like one would expect, being that there is no actual EVENTS table per se, it
is easier said than done. Since the table is unbounded, the set of all rows
would be those rows from the earliest through latest dates that can be
represented in a timestamp field. Not only would you get an unwieldy number
of rows, but it would probably take a long time to calculate them. While
this would be (technically) the correct way for the SELECT to work, it isn't
practical. So it was decided to just return events for the current day up
through the current time. For whatever it is worth, I would like to see
SELECT * FROM EVENTS return rows for all events starting from as far back as
the event record retention goes up through the current time.
Regards, Andy <<
<Prev in Thread] Current Thread [Next in Thread>
  • Re: select * from events - only today's events, Mark Bertrand <=