本节内容:
拼接SQL字符串与日期模糊查询
例1,拼接带有变量的字符串
复制代码 代码示例:
"UPDATE Type_Medium_Info SET " + strType_Field + "=' " + strContent + " 'WHERE Assert_Sn = '" + strAssert_Sn + "' AND Machine_Id= '" + strMachine_Id + "' AND Type_Med_Sn = '" + strType_Med_Sn + "' "
例2,模糊查询日期
复制代码 代码示例:
SELECT * FROM Log_Info WHERE CONVERT(DATE,Log_Date,120) LIKE '2012-12-23%'