안드로이드 개발 질문/답변
(글 수 45,052)
select months from schedule
where SUBSTR(date,1,6) = '201012' <-이렇게 sqlitebrowser 에서는 값이 나오는데요
코드상에서
String s [] = {"_id","months"};
String w = years.getText().toString()+months;
String where = "SUBSTR(date,1,6) = " + w;
Cursor c = ac.getContentResolver().query(MyProvider.CONTENT_URI,
s,
where,
null,
null);
이렇게 하면 if(c.moveToFirst()) 가 false 가 떨어집니다.코드상에서 쿼리문이랑 툴에서 하는거랑 틀리나요?
where SUBSTR(date,1,6) = '201012' <-이렇게 sqlitebrowser 에서는 값이 나오는데요
코드상에서
String s [] = {"_id","months"};
String w = years.getText().toString()+months;
String where = "SUBSTR(date,1,6) = " + w;
Cursor c = ac.getContentResolver().query(MyProvider.CONTENT_URI,
s,
where,
null,
null);
이렇게 하면 if(c.moveToFirst()) 가 false 가 떨어집니다.코드상에서 쿼리문이랑 툴에서 하는거랑 틀리나요?



