2016년 11월 21일 월요일

Get row with condition with variable


Hello to all,
I would like to select the NAME where the AGE is lower than a certain variable1 and HEIGHT is lower than a certain  variable2 where variable1 and variable2 contains 2 numbers inserted by the user.
Example: the fusion table contains the following two rows.

AGE - HEIGTH - NAME
18    -   1,7       - Thomas
25    -   1.8       - John

The user inserted '22' in the Textbox AGE and '1,75' in the Textbox HEIGTH and gets as result 'Thomas'

Thank you in advance to who'll help me :)

-- 
send a select statement to the table like this
SELECT NAME FROM <tableid> WHERE AGE < variable1 AND HEIGHT < variable2

Taifun

-- 
Hi Teifun,
I receive a parse error . I think that the problem is the way with wich I refer to the variables in the condition.

The condition is:
"età < AGE AND altezza < HEIGTH". I paid attentions to the empty spaces before and after the <.
Any suggestion?

Thank you

-- 
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.


Taifun

-- 
Hi Taifun,
attached the block with the table and the error.
Thank you again

Immagine.png 표시 중
Immagine2.png 표시 중

-- 
instead of using the texts eta and altezza you should use the global variables eta and altezza instead... just use the join block to join these values ...

Taifun

-- 

Hi Taifun,
I tried but it does not work. I tried also to simplify but I received the same error. I attached a pict.

Thank you very much for the support

Immagine.jpg 표시 중


-- 
do the Pizza Party tutorial to learn, how to quotify your values, then try again
also use Do it to debug your condition, see also tip 4 here 

Top 5 Tips: How to learn App Inventor

and


-- 

댓글 없음:

댓글 쓰기