Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Active Headcount on a Date

Medium HR Analytics

Return the number of employees who were employed on 2026-06-30: hired on or before that date and either still employed or leaving after it.

Table schema

Employees(id INT PRIMARY KEY, hire_date DATE, leave_date DATE NULL)

Sample data

id | hire_date | leave_date
1 | 2020-01-01 | NULL
2 | 2025-03-01 | 2026-05-01
3 | 2026-02-01 | NULL
4 | 2026-07-01 | NULL

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.