I have a HR database with a "Employee" table, where we keep all our employee records. The main fileds are EmplId, Lname, Fname, JoinDate, LastDay, JobStat and much more. JoinDate is the date when the employ join the company and LastDay is the date when employ resigns or fired or permanantly leaving company for any reason. Every year company has to submit some reports to the local Govt offices on the employee status data of full year, starting from 01 September to next year 01 Septemper. I set everything exactly as they need in a button click. But I am having difficulty to set one query where they need dates when we had the min and max number of employees during that year. The logic behind this is, we should have the count of employees on first of September of the selecting year, and whenever a new employee join the company, the count should increase by one and whenever an employee leaves the company, count should decrease by one. Then I need to find the dates when we had the min / max number of employees during that year. FYI, now 2000+ employee records are in the database. New people joining and also leaving day by day. I mean, from last Sept till date, 43 people join the company, out of which 24 of them already resigned. Appreciate your help to set up the query/Queries to solve this. Is this make sense or need to have more info on database?
Thank you in advance. God Bless You.