> Rob Richardson wrote:
>> Put single quotes around Testitem:
>>
>> sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, CAMOUNT 
) VALUES ( 5, 2012-08-29, 'Testitem', 300 )");
> 
> And around cdate too. There are no dedicated date type in sqlite, 2012-08-
29 is
> treated as expression ((2012 - 08) - 29). Result will be 1975, not what 
you
> might have expected.
> 
> sprintf( sqlquery, "INSERT INTO tblTest ( CINDEX, CDATE, CDESCR, CAMOUNT )
> VALUES ( 5, '2012-08-29', 'Testitem', 300 )");
> 
> And you likely should use sqlite3_prepare_v2, placeholders, sqlite3_bind_
int and
> sqlite3_bind_text instead of sprintf.

Thank you for answers, single quotes helped.

Regarding other functions, is there any example for them ? I used "5 
minutes" example and there is nothing like that. sprintf formatting works 
well for me so far.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to