Help with SQL string construction

S

steve

Hi,
I apologize if I am a bit out of topic.

I am trying to create an interface that will consist of a few dropdown lists
that once selected will create an SQL string for the query.

Now, its easy to dynamically construct the string from its subparts, what i
need help with is the algorithm, because the user will have the option of
NOT choosing all the controls which will lead to longer or shorter strings.

Are there any links or examples for me to follow? My own search was not
successful.

TIA
-steve
 
S

steve

You are right Cor, I should have done this. :)
Ok, here are some examples which would give you a good idea:
(actually mine are a bit more complicated but it would be too long trying to
explain my database in a short message)

Also, to save time i will not write the actual SQL syntax but rather the
description, as i said the syntax is not a problem.

- For London and Paris extract all Customers where their yearly purchases
are above 50,000

- Extract all Cities where there are Employees with yearly sales of <30,000
and >15,000 AND they work for the
company for > 2 years

-Return all Customers' names and cities and their associated Salesman name
where the last year's sales are > 50,000

etc.

As you see the problem lies in the algorithm and having the right choices
in the interface (dropdown lists and fill-out textboxes) rather than the
actual syntax.

TIA
-steve
 
C

Cor Ligthert

Steve,

In my opinion just first a spreadsheet with columns and than make from that
your decissions.

I think that one of your choises will be the listbox because that has a
multiselect.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top