sql.add('select from view_outgoods');
sql.add('where opDate between '+quotedstr(datetostr(qssj.date))+' and '+quotedstr(datetostr(zzsj.date)));
该sql语句想查在某个日期段的数据,后台数据库是sqlserver,在表中的opdate字段是datetime,如果该字段值只有日期没有时间就可以查处,如果既有日期又有时间时,就不能查出来,这是什么原因呢,该如何该呢???
sql.add('where opDate between '+quotedstr(datetostr(qssj.date))+' and '+quotedstr(datetostr(zzsj.date)));
该sql语句想查在某个日期段的数据,后台数据库是sqlserver,在表中的opdate字段是datetime,如果该字段值只有日期没有时间就可以查处,如果既有日期又有时间时,就不能查出来,这是什么原因呢,该如何该呢???
Sql:=Sql+' and dbill_date >= #'+datetostr(DateFrom)
+'# and dbill_date <= #'+datetostr(DateTo)+'# '
sql.add('select from view_outgoods');
sql.add('where opDate between '+quotedstr(datetostr(qssj.date)+' 00:00:00')+' and '+quotedstr(datetostr(zzsj.date)+' 23:59:59'));