3
に動作していないと私は月、年、日(3別々のcolumns
)に変換しています。それはうまくいきますが、私は結果を月と年で降順で並べ替える必要があります。ここでORDERは、年DESCは私が日付フィールドで<code>table</code>を持っているSQLiteの
は私のクエリです: -
Cursor c = database.rawQuery(
"select count(*) as TotalCount, tDate, " +
"sum(case when type = '1' then Amount else 0 end) \"Income\", " +
"sum(case when type = '2' then Amount else 0 end) \"Expenses\", " +
"(sum(case when type = '1' then Amount else 0 end) - sum(case when type = '2' then Amount else 0 end)) \"Profit\", " +
"strftime('%d', tDate) as DayPart, " +
"strftime('%m', tDate) as MonthPart, " +
"strftime('%Y', tDate) as YearPart " +
"from library " +
"group by MonthPart, YearPart Order by YearPart,MonthPart DESC",
null
);
それはだけMonthPartでないYearPartとMonthPartの両方で降順で表示されます。助けてください。
日付の部分を保管しないでくださいを。 1列として保存する – Jens