DateTime.Year
DateTime.Month
YEAR
MONTH
select t1.* from tbl1 t1, tbl2 tbl2 where t1.month = convert(int, datepart(mm, t2.datecolumn) and t1.year = convert(int, datepart(yyyy, t2.datecolumn)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)