PDA

View Full Version : Using the values in a cell for a query


Tycho
09-20-03, 13:03
I have an Oracle database with a 3 tables and a few thousand records.
I want to base a query to an Oracle database on values in a couple of cells. The query isn't the problem but i can't figure out how to get it to use values from a cell for the constraints.

One solution i found if i wan't a count based on the gender is to use for example :

SELECT COUNT(*) FROM db.table WHERE GENDER=[Wich Gender ?];

This pop ups an dialog where you can fill in the criteria.
However this way i can't get it to return a count for both.

Further searching led me to VBA (never worked with it :( ). But i can't figure out how i get it to use the value of a cell in a query.

Can anyone point me in the right direction ?