Need little assistance
Posted
by Umaid
on Stack Overflow
See other posts from Stack Overflow
or by Umaid
Published on 2010-05-02T09:01:23Z
Indexed on
2010/05/02
9:07 UTC
Read the original article
Hit count: 271
I am iterating in current days, so need little assistance
for (int I=-1; I<30; I++)
{
for (int J=0; J=30; J++)
{
for (int K=1; K=30; K++)
{
SELECT rowid,Month, Day, Advice
from MainCategory
where Month= 'May '
and Day in ((cast(strftime('%d',date('now','I day')) as Integer)),(cast(strftime('%d',date('now','J day')) as Integer)),(cast(strftime('%d',date('now','K day')) as Integer)));
}
}
}
What if i want to go in reverse order also
for (int I=-1; I<30; I--)
{
for (int J=0; J=30; J--)
{
for (int K=1; K=30; K--)
{
SELECT rowid,Month, Day, Advice
from MainCategory
where Month= 'May ' and Day in ((cast(strftime('%d',date('now','I day')) as Integer)),(cast(strftime('%d',date('now','J day')) as Integer)),(cast(strftime('%d',date('now','K day')) as Integer)));
}
}
}
On every previous click, i want to fetch 3 records so do i need to iterate till 3 or make it on all record 30 in a month from which i want to fetch.
© Stack Overflow or respective owner