查询:
日期<某时段月份的1号
法一:
select* from t_DATA
WHERE T1.FYear*100+T1.FMonth<
(SELECT FYear FROM dbo.t_1 WHERE ....)*100+(SELECT FMonth FROM dbo.t_2 WHERE ......)
法二:
---sql会拼接字符串,把他当做日期;但此举有风险,想要完全没风险,就把这拼接的字符串转换成日期格式
select* from t_DATA
WHERE T1.FDate<
(SELECT FYear FROM dbo.t_1 WHERE ....)+'-'+(SELECT FMonth FROM dbo.t_2 WHERE ......)+'-'+'01'