Well, I think every PC database program from Knoweldgeman Reflex, Paradox, Revelation, dBase IV, FoxPro and <insert entire history of the personal computer industry for the last 30 years) has used the term QBE in one way or another – but I never seen that the “general” term implied, restricted to use of the term was referring to some original term cooked up many years ago by IBM.
And in fact Oracle, MySQL, PostgreSQL, SQL server, etc. again all have for EVER used the term query by example for their systems – again none ever were referring to some industry standard or propriety term that restricted the use of the term to IBM’s viewpoint.
So while the term QBE is attributed to Zloff, the general term used by every database vendor on the planet never restricted or used the term QBE to refer to Zloff’s particular approach or implementation – especially for desktop database systems like Access as opposed to server based ones as per your reference.
>> Clear, concise and elegant
No, it not. Things always sounds simple when all the details are left out. It is ONLY simple and elegant until you share how the manager table (if one exits) was first selected? And how is that table going to be related to the employee table? (or in fact in this case not related, but the ONE value for the given manager table is going to be used as criteria for ANOTHER table).
So without how such two related tables were selected and defined into the QBE is the REAL question and meat here. (and without such details, then the “simple” part is really some imagined fantasy of simple when it is not the case at all).
Anyway, semantics aside from the above computer history lesson?
It likely would be far more user friendly to build a form or some type of UI and prompt the user. You could built the form to select the manger with the wizards and then launch the employee salary report.
I am reasonable sure that Zlfoof’z original QBE would NOT allow you to type in “text” values such as “SAL” in the salary column – you have to use the SAME datatype. In this case we talking about a number value – so you can’t just type in TEXT into the salary for the QBE, you need to provide a number. The "cool" underlining feature really only proved a few lines of “preview” data is VERY different then allowing one to mix and match data types in a QBE criteria box.
And if you going to print the results? Well, you don't really much print out query results - for printing
you are talking about a report – not a query. However, let’s use the Access QBE on a report. This is how you would approach this:
In the above you select advanced filter to launch the Access QBE. It will display on top of the report, but I moved it to the side in above and typed in a criteria > 60000.
As I stated, you can’t type in “different” data types into the Access QBE.
However, now let’s use the QBE to get everyone with a salary more than SAL. As noted, until you describe your table structures, we really can’t give a solution. But assuming that you have a table of managers?
This this would work:
So just keep in mind every product in the marketplace has its own definition of “QBE”. And the QBE from the 1970's was a challenge for aerospace engineers, let alone desktop PC users.
So from Oracle, SQL server, Access and darn near every product on the planet that has a QBE? None to my knowledge allow you to “mix” the data type in say a salary column UNLESS such a definition was created beforehand to “define” what SAL will mean. (in other words, you only gain such ease of use if you anticipated the question before hand). And I have used IBM’s “universe” system in which a natural like query language existed – but they did not use a QBE in that system!
So above shows how to answer the question of finding those with a salary > SAL with standard query designers that exist in the marketplace today.
And I used a report since you wanted to “print” the results. You can just create a query and use the above same criteria and not have to build a report.
Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
******@msn.com