|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
*Sorry if this is a double post, got an error the first time.
Hey guys, in a pinch with this one. I need assistance trying to figure out this query where I need to join 3 different tables. Table 1: xORDERS Table 2: xINVENTORY Table 3: xSUPPLY I'm trying to do a querry to translate two codes I have in xORDERS through a select statement. in xORDERS there's the columns INVCD and SUPCD. Each are 6 digit codes, that match up to columns in xINVENTORY and xSUPPLY. In both of those tables, the column is titled xCODE. What I want to do is say, take all of the entries in xORDERS, and for every INVCD code, go to xINVENTORY, find that same code and return the value of the column titled xLABEL. Also, for every SUPCD code, go to xSUPPLY, find that same code and return the value of the column titled xLABEL. I can get one half of it to work, but it always errors when I try to get the second half. I'm really pressed for time on this project, and my only hangup is this query. Any assistance would be awesome. |
|
#2
|
||||
|
||||
|
You could try something like this:
Code:
SELECT xOrders.field1, xOrders.field2, xInventory.xLabel, xSupply.xLabel FROM xOrders, xInventory, xSupply WHERE INVCD = xInventory.xCode and SUPCD = xSupply.xCode If this doesn't work, post the code that you're using and we'll take a look at that.
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Sql Join Query Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|