I am trying to query the EventLogs to determine if they are exceeding 80% of
their maximum file size, but this query doesn't retun any records. Here is
my query string:

Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NTEventlogFile
where (FILESIZE > (.80 * MAXFILESIZE)) and filename = 'appevent' ", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

If I change the compare operand to "<=", it doesn't return any records
either. SO, I assume that the querystring doesn't like the (.80 *) muliplier
in the query.

As of now, my work around is to return all records and use an If...then to
determine if the FILESIZE is 80% of the MAXFILESIZE.

...just trying to cut corners! My guess is that the type cast for the
FILESIZE and MAXFILESIZE is character - not number?? ...any clues?

PS...I have debugged the "numbers" - the querystring is logically correct
and should return a record set.
--

-Kevin

RE: WMI Script - Query Syntax by KevinBuchanan

KevinBuchanan
Sun Jun 19 23:15:02 CDT 2005

Update...sorry, but in last post, I had included my debug for the application
event log (filename - 'appevent'). In "production", I would have removed
this condition! However - it still doesn't seem to like any math operations
in the query!

Thanks!!
--

-Kevin


"Kevin Buchanan" wrote:

> I am trying to query the EventLogs to determine if they are exceeding 80% of
> their maximum file size, but this query doesn't retun any records. Here is
> my query string:
>
> Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NTEventlogFile
> where (FILESIZE > (.80 * MAXFILESIZE)) and filename = 'appevent' ", "WQL", _
> wbemFlagReturnImmediately + wbemFlagForwardOnly)
>
> If I change the compare operand to "<=", it doesn't return any records
> either. SO, I assume that the querystring doesn't like the (.80 *) muliplier
> in the query.
>
> As of now, my work around is to return all records and use an If...then to
> determine if the FILESIZE is 80% of the MAXFILESIZE.
>
> ...just trying to cut corners! My guess is that the type cast for the
> FILESIZE and MAXFILESIZE is character - not number?? ...any clues?
>
> PS...I have debugged the "numbers" - the querystring is logically correct
> and should return a record set.
> --
>
> -Kevin