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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL based on query

Status
Not open for further replies.

crystal0streaks

Technical User
May 11, 2006
39
US
I have a query with [MODEL#] and [PRICE] is there a way to make it automatically select the appropriate price for individual models? I'm assuming this can be done in SQL?

-crys
 
yes, this can be done in SQL, all you have to do is, instead of an INNER JOIN or LEFT|RIGHT OUTER JOIN, in this case you have to use an APPROPRIATE JOIN

:)

r937.com | rudy.ca
 
How exactly do I do this?
With WHAT ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Ok, in a the query I have, there are Model#s and Prices for the Model#s, I want to have them linked together and placed in a query I have set up already that links to a report. I was wondering what an example SQL appropriate join is.

-crys
 
sorry, crys, what we are trying to tell you is that you haven't given anywhere near enough information for us to begin to help you

p.s. there is no APPROPRIATE JOIN in SQL

:)

r937.com | rudy.ca
 
...I'm a bit confused, there is a thing called an appropriate join, but it's not in SQL, so where do I put it? And what information do you need for to help me?

-crys
 
Were are [MODEL#] and [PRICE] coming from and how are they related ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i have a great idea

why don't you give us a few sample rows of data that you have in your table, and then tell us which prices are the appropriate ones

like this --

model# price
23WTF5 12.98
23WTF5 16.98
23WTF5 19.98
AB937D 10.00
AB937D 15.00

for model# 23WTF5 the appropriate price is _______, while for model# AB937D the appropriate price is _______



r937.com | rudy.ca
 
I have combo boxes for the [MODEL#] and the same for [PRICE], but I would like to be able to select a specific Model# and have the corresponding price be automatically inserted. I've come to understand that this can be done in a query. Does this help?

-crys
 
MODEL# PRICE

X-1000B --->$183
X-1000C --->$250
X-1000CH -->$301
X-1000CE -->$349
X-1000SB -->$149

-crys
 
i think you simply need a lookup table, where model# is the primary key and price is what you're looking up

as for getting this to drive a combo box, maybe PHV knows, but it is beyond me (sorry, the only reason i'm in this forum is for the SQL)

r937.com | rudy.ca
 
A lookup table seems to be exactly what I'm looking for. Thanks for your help.

-crys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top