Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query from table

Status
Not open for further replies.

Steve1001

Technical User
Nov 1, 2002
17
US
Hi

I have a table of tarrifs, the vertical column is weights,
the horizontal delivery areas

a b c d

1 1.0 2.0 2.5 3.0
2 1.5 2.5 3.0 4.0
etc.

is it possible to make a query that will select the value based on weight, and delivery area ?

Many thanks

Steve


 
assuming that the delivery area value is a numeric as it would be if it were a key and the weight is a numeric, the sql statement would look like:

dim arfname as integer
dim wght as long
sql = "SELECT " & arfname & " FROM TarrifTable WHERE Weight = " & wght

you may have to precondition the weight to fit it into the weights in the table.
 
with your column headings, it would be

arfname = areaheading
sql = "SELECT '" & arfname & "'.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top