You can use parentheses for an inner comparison.
Select * from Win32_NTLogEvent Where ( Logfile = 'System' Or Logfile = 'Application' ) AND Type <> 'Information' AND TimeGenerated > '" & dteDate & "'
题
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Application' AND Type <> 'Information' AND TimeGenerated > ' " & dteDate & "' ")
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System' AND Type <> 'Information' AND TimeGenerated > ' " & dteDate & "' ")
regards : msinfo
解决方案
You can use parentheses for an inner comparison.
Select * from Win32_NTLogEvent Where ( Logfile = 'System' Or Logfile = 'Application' ) AND Type <> 'Information' AND TimeGenerated > '" & dteDate & "'