|
-
Aug 15th, 2001, 08:19 AM
#1
Thread Starter
New Member
ADO Recordset Filter Property
I have a disconnected recordset that I am trying to do some ambitious filtering with. I know how to get what I need with a SQL filter but they do not work as an ADO recordset filter.
example: (SQL) Job > 100 AND Job < 200 AND Cost >
100
but ADO.Filter needs it like
(Job > 100 AND Cost > 100) OR (Job < 200 AND Cost > 100)
which returns an incorrect set
Any help on filtering multiple columns by multiple values with the ADO filter property would be greatly appreciated
-
Aug 15th, 2001, 10:39 AM
#2
Lively Member
tjfse2000:
(Job > 100 AND Cost > 100) OR (Job < 200 AND Cost > 100)
is not logically equivalent to
Job > 100 AND Job < 200 AND Cost >100
The filter that you tried to use just returns records that meet the second criterion (cost > 100) because of your use of the OR operator. If you stick an AND in there instead, it should work. But I don't understand why you need to do that. There are no special limitations on ADO recordset filters that would require such a mess. Your original idea should work, just put some parentheses around the different criteria, like so:
Code:
rst.Filter = "(job > 100) and (job < 200) and (cost > 100)"
This works for me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|