Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Table Filter with "and"

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2008, 09:04 AM
Newbie
 
Join Date: May 2008
Posts: 3
Default Table Filter with "and"

hi,


i would like to make a Filter like that but it doesnt work, Whats wrong?


Thank you

Hatmut


sr = "*" & Table1Textbox.Text & "*"
sr1 = "*" & Textbox30.Text & "*"

Table1.Filter("benennung LIKE '" & sr & "'" AND "benennung LIKE '" & sr1 & "'")
Reply With Quote
  #2 (permalink)  
Old 06-23-2008, 10:07 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:

sr = "*" & Table1Textbox.Text & "*"
sr1 = "*" & Textbox30.Text & "*"

Table1.Filter("benennung LIKE '" & sr & "'" AND "benennung LIKE '" & sr1 & "'")
Do you have a textbox named "Table1Textbox"

Also I usually start with 1 filter item, and if it works add the 2nd

-= edit=-
tried it and i don't think the TABLE allows this since you are searching in the same column at the same time while the example is using a different column
as a workaround I would filter using one argument, copy that information to a temp table and search using the 2nd argument

Unless Erel has a solution :-)




Code:
Sub App_Start
    Form1.Show
        Table1.AddCol(cString,
"benennung",80,False)
    i = 
0
    
Do Until i = 60 
    Table1.AddRow(
"Test"&i)
    i = i + 
1
    
Loop        
End Sub
Sub Button1_Click
'sr = "*" & Table1Textbox.Text & "*"
'
sr1 = "*" & Textbox30.Text & "*"
'
Table1.Filter("benennung LIKE '" & sr & "'" AND "benennung LIKE '" & sr1 & "'") 
Table1.Filter("benennung LIKE 5" AND "benennung LIKE 9"
End Sub

Last edited by Mr_Gee : 06-23-2008 at 10:22 AM.
Reply With Quote
  #3 (permalink)  
Old 06-23-2008, 01:20 PM
Junior Member
 
Join Date: Feb 2008
Location: Lubbock, TX
Posts: 36
Wink SQL Filter

I tried this on a SQL database and it worked for me.

select * from inventory where description like '%Milk%' and description like '%GOAT%'

yielded one record with milk and goat in the description.

also tried it with OR and had all of the records with milk in the description and one goat.

To filter you must use the percent sign as shown

Hope this is what you are looking for
Reply With Quote
  #4 (permalink)  
Old 06-23-2008, 01:45 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by jeterry View Post
I tried this on a SQL database and it worked for me.
To be honest I would also go for SQL in this case.
Reply With Quote
  #5 (permalink)  
Old 06-23-2008, 03:30 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi all,

the solution looks like this:
Code:
Table1.Filter("benennung LIKE '" & sr & "' AND benennung LIKE '" & sr1 & "'"
The AND has to be within the "".


specci48
Reply With Quote
  #6 (permalink)  
Old 06-24-2008, 11:35 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by specci48 View Post
Hi all,

the solution looks like this:
Code:
Table1.Filter("benennung LIKE '" & sr & "' AND benennung LIKE '" & sr1 & "'"
The AND has to be within the "".
specci48
I can't believe I missed that one :-(

that did the trick, kudos to you
Reply With Quote
  #7 (permalink)  
Old 06-25-2008, 09:53 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Mr_Gee View Post
I can't believe I missed that one :-(
I had to look twice, too...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions (Windows Mobile) 12 09-10-2008 03:04 PM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions (Windows Mobile) 6 03-23-2008 11:07 AM
Icon / Image in a Table to "Click" on burd27 Questions (Windows Mobile) 2 03-16-2008 03:04 AM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 09:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions (Windows Mobile) 0 12-05-2007 02:59 AM


All times are GMT. The time now is 09:55 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0