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

single master record to multiple records 1

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
Hello,

I have two tables a sales table and a commissions table. In my sales table I have the following fields:

Salesrep, custnum, custname, itemnum, qty, price

In my commmission table I have the following fields

salesrep, custnum, itemnum, commprc

the problem that I have is that the commissions table has the base item number and the sales has the basenumber plus extra characters
for example:
Code:
Base Part Number	Sales Item could be
3000	              3000BK
	              3000BL
	              3000GR
	              3000WH
	              3000RD
	              3000YW
	              3000GR
	              3000

I am not sure how to go about building my query so I can matach the base item to all the items in the sales table.
 
hi,
Code:
from sales a, commissions b
where a.itemnum=left(b.itemnum,len(a.itemnum))


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
SkipVough!!!

Thank you!!!! that worked!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top