Returning latest result?

(imported topic written by Rocachino)

Two questions:

How would I return only the latest event from the relevance below? Also, How would I search between a specific time frame? Ex. between 04/11/08 and 4/15/08

q: (event id of it mod 2147483648 mod 1073741824 , source of it, time generated of it) of records whose (now - time generated of it < 1*day) of application event log

Thanks

(imported comment written by jessewk)

this should do it… my relevance is not as simple as it could be, but it’s efficient instead:

(
event id of it mod 2147483648 mod 1073741824 , source of it, time generated of it
)
of item 1 of it
whose
(
time generated of item 1 of it = item 0 of it
)
of
(
it, records
whose
(
now - time generated of it < 1day
)
of application event log
)
of maximum of times generated of records
whose
(
now - time generated of it < 1
day
)
of application event log

(imported comment written by jessewk)

Oh, I missed the second part of your question. You would replace the 2 whose clauses that filter out records:

(
event id of it mod 2147483648 mod 1073741824 , source of it, time generated of it
)
of item 1 of it
whose
(
time generated of item 1 of it = item 0 of it
)
of
(
it, records
whose
(
date
(
local time zone
)
of time generated of it <= date "15 Apr 2008"
AND
date
(
local time zone
)
of time generated of it > date “11 Apr 2008”
)
of application event log
)
of maximum of times generated of records
whose
(
date
(
local time zone
)
of time generated of it <= date "15 Apr 2008"
AND
date
(
local time zone
)
of time generated of it > date “11 Apr 2008”
)
of application event log

(imported comment written by Rocachino)

Thanks! That worked great!