Hi all,
call me stupid but after some days of try and a lot of Googleing, im still
wondering how to solve my problem:
i need to execute a query that updates 3 integer fields (AA, MM, GG) of a
table, containing respectively today year, today month and today day:

update settings set AA=strftime('%Y', 'now'), MM=strftime('%m', 'now'),
GG=strftime('%d', 'now')

looks working well, but later, when i read that values:
<xcode>
    const char *sql="select AA,MM,GG from settings";
    sqlite3_stmt *statmentS;
    if (sqlite3_prepare_v2(database, sql  ,-1,&statmentS, NULL)==SQLITE_OK)
{
        if (sqlite3_step(statmentS)==SQLITE_ROW) {
            UserSettings *k = [UserSettings sharedUserSettings];
            k.AA=sqlite3_column_int(statmentS, 1);
            k.MM=sqlite3_column_int(statmentS, 12);
            k.GG=sqlite3_column_int(statmentS, 13);
...
</xcode>

i obtain correct values, but in inverse order:

AA (year) contains the day number
MM (month) is correct
GG (day) contains the year

using SQLIte Manager addons for Firefox, this query:
 select  strftime('%Y', 'now'), strftime("%m", "now"), strftime("%d", "now")
from settings
returns correct values, running or loading value into XCode simulator looks
not working and i dont know why. :'(


does anyone can suggest me what to fix or check?
thx in advance, marco
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to