I am trying to write the following SQL query where I have to select different functions for different inputs. The functions returns the number of employees in each department after checking the @Dept parameter.

```
DECLARE @Dept varchar(10)='IT'

IF @Dept='IT'
    Select count(Employees) from dbo.ITDept()
IF @Dept='HR'
    Select count(Employees) from dbo.HRDept()
IF @Dept='Accounts'
    Select count(Employees) from dbo.AccountsDept()

```

Is there a better way of writing this query?