postgresql日期查詢注意問題,數據庫字段的格式化和等式右邊的值的格式化要一至

string sql = string.Format(" select sql from " + App.dao.AaaaPrefix2 + "systranslog where tablename='{0}' and docno='{1}' and usercode='{2}' and to_char(logdatetime,'yyyy-mm-dd HH24:MI:SS')='{3}' ", dr["tableName"].ToString(), dr["docno"].ToString(), dr["usercode"].ToString(), ConvertHandle.ConvertToDateTime(dr["logdatetime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss"));

原文地址:https://www.cnblogs.com/luoyaoquan/p/2508636.html