Question: Here is the sample
![See Sample](https://i.stack.imgur.com/VUGo3.png)

How to get this data based on day name from my table?

Answer: 
```
declare @t table
(
Doctor_Name varchar(20),
Sunday bit, Monday bit, Tuesday bit, Wednesday bit, Thursday bit, Friday bit, Saturday bit
);

insert into @t values
('dr.Sunday', 1, 0, 0, 0, 0, 0, 0),
('dr.Monday', 0, 1, 0, 0, 0, 0, 0),
('dr.Tuesday', 0, 0, 1, 0, 0, 0, 0),
('dr.Friday', 0, 0, 0, 0, 0, 1, 0), 
('dr.Tuesday&Saturday', 0, 0, 1, 0, 0, 0, 1);

select *
from @t
where choose(datepart(weekday, dateadd(day, @@datefirst, getdate())), Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday) = 1;

```
The following query will help you to get result:

```
DECLARE @SqlQuery varchar(8000) 
DECLARE @DateVal DATE = GETDATE(), @DayName varchar(20)
SET @DayName = DATENAME(WEEKDAY, @DateVal);
SET @SqlQuery ='SELECT DOCTORNAME FROM TABLE_NAME WHERE '+ @DayName +'= 1'
EXEC(@SqlQuery)

```