Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
322 views
in Technique[技术] by (71.8m points)

Using OR with AND conditions Simultaneously into AdoTable Filter in Delphi

I am tryin to apply following filter on a AdoTable component but it shows error:

((details_id = 15) OR (details_id = 16) OR (details_id = 17)) AND(personel_id = 5)

the error is :

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

whats the wrong and how can I do this filter. I previously searched it on Delphi help but could not to solve it. Special Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are trying to make a filter on a table it is much more convenient to use TADOQuery and put:

TADOQuery.SQL.Text := 'SELECT * FROM TableName WHERE ((details_id = 15) OR (details_id = 16) OR (details_id = 17)) AND (personel_id = 5)'

where TableName is the name of your actual table. It is also much easier to manipulate with parameter values this way.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.7k users

...