SQLite how to use expression in datetime modifier

In short: I need to calculate the end of the datetime, the given time and start length in minutes.

I have a table with columns StartTime(datetime type) and LengthMinutes(int type). To calculate the final time, I need some sql like this:

select datetime(StartTime, '+LengthMinutes minutes') from my_table;

How do I access the LengthMinutes column from a modifier?

Edited: resolved using the dan04 clause. Thank!

+3
source share
2 answers
SELECT datetime(StartTime, '+' || LengthMinutes || ' minutes') FROM my_table;
+5
source
select datetime(strftime('%s',StartTime)+lengthMinutes*60,'unixepoch') from my_table;
+1
source

All Articles