Answer the question
In order to leave comments, you need to log in
Form a MS SQL query to select the minimum event and subtract a certain time from it?
How to write a Tsql query to select the presence of a user in the workplace?
Here you can take the basis of the database
And here is its Backup
Here is the fidle Task:
SELECT *
from [EVENTS]
WHERE month([date]) = month(getdate()) and year([date]) = year(getdate())
Answer the question
In order to leave comments, you need to log in
normally))
SELECT
COUNT(*) AS_all_events,
SUM(CASE WHEN Event_Id = 3 THEN 1 ELSE 0 END) as _enter_events,
SUM(CASE WHEN Event_Id = 4 THEN 1 ELSE 0 END) as _exit_events
FROM ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question