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!

Cross Tables

Status
Not open for further replies.

JezBullen

Programmer
Dec 11, 2001
23
GB
Hi

I have two tables, the first table as follows....

TempTable
ProductGroup unit make
A £25 CustA

and the second....

RebateLevel
ProductGroup CustA CustB
A .21 .25

I'm trying to get a column on the first table to show the rebate level, which will be "Unit * " either "CustA" or "CustB", depending on the value of Make on the first table. I'm struggling to get a query to do this

Apologies if this doesn't make sense but I'm getting confused myself

Thanks in advance
JB
 
If you can change your table structure to a normalized model this would be easier:

RebateLevel
ProductGroup CustomerType LevelAmount
A CustA .21
A CustB .25

with the above setup you are looking at an easy join on TempTable and RebateLevel

with your existing structure, you will need to normalize your table in a query and then join the temptable to the "normalized" data in your query.

There are several threads that do something similar. If you can't change your table, I'll help you with the query.

leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top