SQL执行时报错,日期条件因该怎么给才合适?
LogCommand-> CommandText = "delete from CADLOGS where 日期时间 < # " + (Now().CurrentDate() - SaveDayRadices).FormatString( "yyyy-mm-dd HH:mm:ss ") + "# ";
LogCommand-> Execute();
执行时报错,日期条件因该怎么给才合适?
[解决办法]
LogCommand-> CommandText = "delete from CADLOGS where 日期时间 < :D ";
LogCommand-> Parameters-> ParamByName( "D ")-> Value=Now().CurrentDate() - SaveDayRadices;
LogCommand-> Execute();