Get column value out from SQL where column name is same as input

I have a queue item with name TIM and that same name also exist as column name like TIM in database

data in database look like this.
Herry, Tim, Tomy , Date
0,1,0, 03-10-2024
0,1,1,02-10-2024

I want to read Tim value of date 03-10-2024.

which sql statment i can use and plus the result i will i need to check with if statement… how can i do that…

SELECT Tim
FROM your_table_name
WHERE Date = ‘03-10-2024’;

Store this return value in variable and then you can check with your Column using if condition

Hope this will work

Happy automation

Already done with it but thanks for reply.

So you are facing any issue ?