Search Results

Search found 8 results on 1 pages for 'umaid'.

Page 1/1 | 1 

  • Need to get 3 record for database on current date using sqlite

    - by Umaid
    SELECT rowid, Day, Advice from MainCategory where ((Day = ((cast(strftime('%d',date('now','-1 day')) as Integer)))) and (Month = (strftime('%m',date('now'))))) and ((Day = ((cast(strftime('%d',date('now')) as Integer)))) and (Month = (strftime('%m',date('now'))))) , ((Day = ((cast(strftime('%d',date('now','+1 day')) as Integer)))) and (Month = (strftime('%m',date('now',+1 month))))); What if i make my Month column in Integer data type then it would be. SELECT rowid, Month, Day, Advice from MainCategory where ((Day = ((cast(strftime('%d',date('now','-1 day')) as Integer)))) and (Month = (strftime('%m',date('now'))))) and ((Day = ((cast(strftime('%d',date('now')) as Integer)))) and (Month = (strftime('%m',date('now'))))) , ((Day = ((cast(strftime('%d',date('now','+1 day')) as Integer)))) and (Month = (strftime('%m',date('now',+1 month))))); Please note that I have over this scenerio when I am in middle of month but below query returns 2 records and 1 from begining from all 11 months as (feb is exclusive) then record will be 33 but i need three 3 records from the table and increment it on next button. Please write 3 querys one which return all three record on current date, next all 3 records must be incremented by 1 on every next button click finally all 3 records must be decremented by 1 on every previous button click keep last day and begining date on the month in minds else i have also achieved for middle of month. Running query but returns 33 records instead of 3. SELECT rowid,Month, Day, Advice from MainCategory where Day in ((cast(strftime('%d',date('now','-1 day')) as Integer)),(cast(strftime('%d',date('now')) as Integer)),(cast(strftime('%d',date('now','+1 day')) as Integer)));

    Read the article

  • Need little assistance

    - by Umaid
    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.

    Read the article

  • I need objective-C syntax for calculating bmi

    - by Umaid
    Actually I am working on bmi calculator. Where I would like to calculate bmi for height in inches and weight in lbs and also in need of correct formula for height in cm and weight in kgs. I have tried but couldn't calculate actual value coming withing the range as below. It exceeds the range. BMI Categories: * Underweight = <18.5 * Normal weight = 18.5-24.9 * Overweight = 25-29.9 * Obesity = BMI of 30 or greater

    Read the article

  • How to iterate in this query?

    - by Umaid
    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))); } } } And for the same reason how to decrement in this query 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))); } } }

    Read the article

  • Facing trouble in retrieving relevant records

    - by Umaid
    SELECT * from MainCategory where Month = 'May' and Day in ((cast(strftime('%d',date('now','-1 day')) as Integer)),(cast(strftime('%d',date('now')) as Integer)),(cast(strftime('%d',date('now','+1 day')) as Integer))); Whenever I run this query in sqlite so it returns me 33 records instead of 3. I am insterested in fetching on 3 records of the current month but unable to do so, so plz assist. --Please note: if you can't assist so plz don't post irrelevant answer. I have also modified and try to make it simple but not achieve Select day, month from MainCategory where Month = 'May' and day in ((date('now','-1 day')),(date('now')),(date('now','+1 day')))

    Read the article

  • I need objective syntax for calculating bmi

    - by Umaid
    Actually I am working on bmi calculator. Where I would like to calculate bmi for height in inches and weight in lbs and also in need of correct formula for height in cm and weight in kgs. I have tried but couldn't calculate actual value coming withing the range as below. It exceeds the range. BMI Categories: * Underweight = <18.5 * Normal weight = 18.5-24.9 * Overweight = 25-29.9 * Obesity = BMI of 30 or greater

    Read the article

  • How can I discard 2 choices out of 4 from my Array of choice

    - by Umaid
    Actually I have four choice out of which i need to discard to choice on button click like 50/50 , then it will show only 2 choice for user to select out which one is correct and one is wrong -(IBAction)Rebind:(id)sender { if (i == [QuizArray count]) { if([sender tag] == 1) //if([sender tag] == 1) { [self.CorrectArr addObject:@"A"]; //[self.CorrectArr addObject:mydiet.varOpt1]; } else if([sender tag] == 2) { [self.CorrectArr addObject:@"B"]; //[self.CorrectArr addObject:mydiet.varOpt2]; } else if([sender tag] == 3) { [self.CorrectArr addObject:@"C"]; //[self.CorrectArr addObject:mydiet.varOpt3]; } else if([sender tag] == 4) { [self.CorrectArr addObject:@"D"]; //[self.CorrectArr addObject:mydiet.varOpt4]; } Score *myscore = [[Score alloc] initWithNibName:@"Score" bundle:nil]; myscore.SelectedArr = CorrectArr; [self.view addSubview:myscore.view]; } else { NSString *questionstring = [NSString stringWithFormat:[[QuizArray objectAtIndex:i] varQuestion]]; self.myquestion.text = questionstring; [btn1 setTitle:[[AnswerArray objectAtIndex:i] varAnswer] forState:normal]; if([sender tag] == 1) { [self.CorrectArr addObject:@"A"]; //addObject:mydiet.varOpt1]; } else if([sender tag] == 2) { [self.CorrectArr addObject:@"B"]; //addObject:mydiet.varOpt2]; } else if([sender tag] == 3) { [self.CorrectArr addObject:@"C"]; //addObject:mydiet.varOpt3]; } else if([sender tag] == 4) { [self.CorrectArr addObject:@"D"]; //addObject:mydiet.varOpt4]; } } i = i + 1; //} }

    Read the article

1