title: Query the Win32_NTLogEvent Class to get the errors from last week
body: <p>I want to get events of type error or critical with logfile = application from last week. This query works for first 2 conditions but I don't know how to get only records from last week. I tried "And TimeGenerated > GETDATE()-7" but I got Invalid Query.</p>
  
  <pre><code>Select * from Win32_NTLogEvent where Logfile = 'Application' AND (type ='Error' OR type ='Critical')
  </code></pre>