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

Syntax Help w/Column Names

Status
Not open for further replies.

Overmyhead2

Programmer
Jun 5, 2000
39
US
I have 2 tables:
tblA- Item1
Item2
Item3
Category

tblB- ItemName
Description
Category
I want to SELECT from tblA qty values from the 3 Item Columns & SELECT from tblB ItemName, Description
WHERE tblA.CATEGORY=tblB.CATEGORY
and tblA.Column Names(Item1,Item2,Item3)=tblB.ItemName
First Web Project ..Appreciate any help with this..(-:

Victoria
 
Code:
select countitem1 = count(item1) where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item1=tblB.ItemName,
 countitem2 = count(item2) where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item2=tblB.ItemName,
 countitem3 = count(item3) where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item3=tblB.ItemName

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Code:
  tblA.Item1=tblB.ItemName
or tblA.Item2=tblB.ItemName
or tblA.Item3=tblB.ItemName
 
sorry forgot to tell it where it was counting:
Code:
select countitem1 = count(item1) from tblA where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item1=tblB.ItemName,
 countitem2 = count(item2) from tblA where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item2=tblB.ItemName,
 countitem3 = count(item3) from tblA where tblA.CATEGORY=tblB.CATEGORY
and tblA.Item3=tblB.ItemName

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top