Sql Query on workstations.

Cary Miller 1 Reputation point
2021-10-18T18:33:05.237+00:00

Here is my scenario. I have a SQL database that has a list of when users logged off of a virtual machine.
I want to run a sql query that looks at name field, an event type field and have it look at a selection of time. If it does not find a event type that matches within a certain time field, it will report back the name.

What I have so far.
Select *
from vim_events.dbo.event.historical
where moduleandeventtext like '%machinename%' and eventtype like '%agent_ended%' and time>=convert(datetime, '2021-08-18')

it will spit back a report of Agent_ended queries that exist after 08/18/2021, but I need it to spit out a list of workstations that don't have an agent_ended after that date.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,765 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,555 questions
{count} votes