I just coded this way:

```
Cursor cursor;
String sql = "SELECT l.acao, SUM(strftime('%s',l.data_fim) - strftime('%s',l.data_inicio)) AS total_time," +
             "FROM logs AS l " +
             "WHERE l.data_fim IS NOT NULL " +
             "GROUP BY l.acao";

```

I need to sum the seconds between two dates and I named this sum `total_time`. But when I try to get the result of `total_time` it always returns `null`, see next code:

```
String totalTimeInSeconds = (String) cursor.getString(cursor.getColumnIndex("total_time"));

```

When I put this same query in SqlLiteStudio it works perfectly. What am I doing wrong?