0

When modifying the date of a column on python with sqlite3 I receive the None value.

datetime(Date, '+4 months')

works, but

datetime(Date, '+' || Test || 'months')

does not and sends me back None value. Test is an integer datatype column.

Any idea?

1 Answer 1

1

Add a space before months:

% sqlite3
sqlite> select datetime('2018-02-13', '+' || 4 || ' months');
2018-06-13 00:00:00
sqlite> select datetime('2018-02-13', '+' || 4 || 'months'); 

sqlite>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.