QString strdate=ui->dateEdit->date().toString("yyyy-MM-dd"); QString strdate1=strdate; QString strStartTime =strdate.append(" 00:00:00"); QString strEndTime = strdate1.append(" 23:59:59"); QString wheresql=QString("where datetime(time)>=datetime('%1') and datetime(time) <= datetime('%2')").arg(strStartTime).arg(strEndTime); dbPage->setOrderSql((QString("%1 %2").arg(countName).arg("asc"))); dbPage->setWhereSql(wheresql); dbPage->select(); ui->stackedWidget->setCurrentIndex(0); ui->btnRetrieval->setText(tr("返回"));
没有引号查询出错