String str_sql = "select * from health_advice where adviceTime between datetime('" + history + "','localtime') and datetime('" + history + "','start of day','localtime','+1 month')";
[解决办法]
那你把我上面的history上面的''去了试试 [解决办法]
String str_sql = "select * from health_advice where adviceTime between datetime(" + history + ",'localtime') and datetime(" + history + ",'start of day','localtime','+1 month')";
[解决办法]
难道你的sql语句拼的不对?
String str_sql = "select * from health_advice where adviceTime between datetime('" + history + "','localtime') and datetime('" + history + "','start of day','localtime','+1 month')";
String str_sql = "select * from health_advice where adviceTime between datetime('" + history + "','localtime') and datetime('" + history + "','start of day','localtime','+1 month')";
String sql = "select * from health_advice where adviceTime between datetime('2013-05-01 00:00:00','localtime') and datetime('2013-05-01 00:00:00','start of month','localtime','+1 month')";
我这样就能查到
晕死了,搞的头大了
String historyA = "2013-05-01 00:00:00"; String sql = "select * from health_advice where adviceTime between datetime('" + historyA + "','localtime') and datetime('" + historyA + "','start of month','localtime','+1 month')";