Sql query to calculate highet price with most matches

  • Thread starter Thread starter ron
  • Start date Start date
R

ron

I need to run a query that will take a table of bids and one of asking
prices. I need to find the highest price I can get to get the maximum
number of matches.

currently I am just using the following:
ClosingPrice = ((Ask + Bid) / 2)

This workds, but I would like the ClosingPrice to be as high as I
possibly can, returning the maximum number of matches.
 
Dear Ron:

I'm guessing the "Ask" price is constant and you just need to know the
maximum value of "Bid" to do this. You can do this with a correlated
subquery. I can try to write this for you, then explain it. In my
experience, this is the best way to help with such a question.

Post the SQL of the query work you have so far. If there's enough
information there, I'll write up the necessary code and reply. Otherwise, I
may have to have more information to continue.

Tom Ellison
 
I need to run a query that will take a table of bids and one of asking
prices. I need to find the highest price I can get to get the maximum
number of matches.

currently I am just using the following:
ClosingPrice = ((Ask + Bid) / 2)

This workds, but I would like the ClosingPrice to be as high as I
possibly can, returning the maximum number of matches.

You haven't made it very clear what you are asking for. Is it the highest
ask price that's lower than the lowest bid price?
 
Back
Top