For more power and flexibility than you can achieve with a fixed lists of fields, there’s query-by-example, a well established approach that allows the construction of complicated Boolean expressions.
For truly graphically ways to specify unlimited arbitrary Boolean expressions, there’re a couple that use pathway metaphors:
Murray, Paton, and Bryce’s Kaleidoquery (Journal of Visual Languages & Computing Volume 11, Issue 2, April 2000, p151-189)
Shneiderman’s Filer/flow (Proceeding of the 54th Annual Meeting of The American Society for Information Sciences, vol. 28, Washington, DC, Oct. 27-31, 1991,
p379-384).
While better than SQL-style Boolean expressions, all of these are relatively complex UIs, likely requiring at least some practice to use well. Thus, any such ad hoc querying ability should probably be insulated as an “advanced” feature. In most applications, users have a few very specific kinds of queries that account for the vast majority of their work (e.g., accounts with in arrears for more than n days). A simple dialog to select canned or semi-canned queries is best for this and should be the default UI.