I am using this query to fetch data from sqlite but only one condition is working but not two at same time.
I am also getting some notification that no such column but it exist.
String lquery = "SELECT SUM(totalcalorie) AS LTotal FROM fooditem
WHERE name = ('" + fname + "') AND foodtype = 'Lunch'";
you might be having null values on those places which you are checking while calling..
go through your code again queries seems write.
change totalcalorie to
INTEGER type in the database schema
comment says that you are using