SELECT * FROM myAddressTable
WHERE CASE DATENAME(month,GETDATE())
WHEN 'January' THEN addrjan
WHEN 'February' THEN addrfeb
WHEN 'March' THEN addrmar
...
WHEN 'December' THEN addrdec END = 'Y'
The better option is not to store addresses with that structure, but something like this instead:CREATE TABLE ValidAddressMonths(addrkey int not null,
Month tinyint not null,
CONSTRAINT PK_ValidAddressMonths PRIMARY KEY(addrkey,Month))
You'd then insert the addrkey and month number only for those months where the address is valid (Y). A simple EXISTS query will find the rows:SELECT * FROM myAddressTable A
WHERE EXISTS(SELECT * FROM ValidAddressMonths WHERE addrkey=A.addrkey and Month=DATEPART(month,GETDATE()))