VB to connect ACCESS database, the SQL query to ask

VB to connect ACCESS database, SQL query.
There is a table of A, record each bidding situation, field are as follows:
Tender, bidding units, bidding price

Want to do a report now, choose a tender units, and then generate bidding statistics of the unit (mainly the statistical units per

Time bidding ranking), are shown in the following fields in the report:
Tender, bidding price, price ranking

If the individual screening of the bidding project, bidding price, through a where judgment is easy to implement, but now with a price

Ranking, how to achieve better? Thank you!

Started by Stev at December 12, 2016 - 1:43 PM

select item, company from table order by price, Then used grid control, grid is ranked number

Posted by Derrick at December 22, 2016 - 1:53 PM

Thank you upstairs, probably before description is not accurate. Hypothesis selection unit: * * * Co. Ltd., generate the following statements:
Project bidding price bidding ranking
Project 88882
Project * * * 77775
Project### 322 1

The name of the project and the bidding price are readily available, selected by where can, the key is behind the "new bid ranking" how to generate?

Posted by Stev at December 27, 2016 - 2:12 PM

To write the code generation.

First, SELECT * FROM A ORDER BY DESC 'if the low bid price in ASC or omit

Then
rs.MoveLast
rs.MoveFirst
For i = 1 To rs.RecordCount
rs!The bidding rank = I
rs.Update
rs.MoveNext
Next i

Posted by Aviva at January 06, 2017 - 2:51 PM

Forget, to bid project statistics:
Using an rsTmp storage project:
Set rsTmp = cn.Executte "SELECT DISTINCT From A bid project"
Do Until rsTmp.EOF
Open "SELECT * FROM A WHERE = "& rsTmp bidding; bidding! &" ORDER BY DESC bid price", cn
rs.MoveLast
rs.MoveFirst
For i = 1 To rs.RecordCount
rs!The bidding rank = I
rs.Update
rs.MoveNext
Next i
Loop

Posted by Aviva at January 08, 2017 - 3:50 PM