Android Question confused in empty ,null , when query database ,

acj200301

Member
i use such sentence to query access database in vb ,

it is ,

SELECT *
FROM table_1
WHERE (

((IIf(IsNull(value_1),'*' , field_1 Like '*' & value_1 & '*'))<>False) AND

'((IIf(IsNull(value_2),'*', field_2 Like '*' & value_2 & '*'))<>False) )

i imitate it in b4a , i make attempts time and again , but the matter(problem) is " IIf(IsNull(value_1) " ,

always failed in " IIf(IsNull(value_1) " ,

i wonder how to do to to achieve such function in b4a ,
一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一
and , it seems that we can not use IsNull() ,Isempty() , to judge empty and null ,
一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一
and i see blank when i put mouse on value_3 ,

sentence is that value_3 = EditText_1.text , when EditText_1 is blank ,

at the outset i think it(black) mean empty or null ,

afterwards i discover it mean "" ,

so i can use [ if value_3 = "" then ] ,

i mean , there iare puzzle in empty , "" , null , and in remind display ,
一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一
thank you very much ,
 

aeric

Expert
Licensed User
Try:
SQL:
PARAMETERS [pvalue1] Text ( 255 ), [pvalue2] Text ( 255 );
SELECT * FROM table_1
WHERE (
([pvalue1] IS NULL OR field_1 LIKE '%' & [pvalue1] & '%') AND 
([pvalue2] IS NULL OR field_2 LIKE '%' & [pvalue2] & '%')
);
 
Upvote 0

acj200301

Member
Try:
SQL:
PARAMETERS [pvalue1] Text ( 255 ), [pvalue2] Text ( 255 );
SELECT * FROM table_1
WHERE (
([pvalue1] IS NULL OR field_1 LIKE '%' & [pvalue1] & '%') AND
([pvalue2] IS NULL OR field_2 LIKE '%' & [pvalue2] & '%')
);
thank you very much ,
i will try it ,
 
Upvote 0

acj200301

Member
hellow , mr.aeric ,

thanks for your solution,

b4a is likeable ,

but , the matter is that users is not massive in china , so it is difficult to find learning material , and i am not good at english ,

i want to ask a question according to your head sculpture ,

it is , can you read and write chinese ?

if you can , may i communicate with you in chinese ?

thank you very much .
 
Upvote 0

aeric

Expert
Licensed User
hellow , mr.aeric ,

thanks for your solution,

b4a is likeable ,

but , the matter is that users is not massive in china , so it is difficult to find learning material , and i am not good at english ,

i want to ask a question according to your head sculpture ,

it is , can you read and write chinese ?

if you can , may i communicate with you in chinese ?

thank you very much .
Yes, you can post your question in Chinese forum.
 
Upvote 0
Top