Click here to Skip to main content
15,904,652 members
Home / Discussions / Database
   

Database

 
Questioncomplex sql query Pin
abhi29198418-Sep-10 12:20
abhi29198418-Sep-10 12:20 
AnswerRe: complex sql query Pin
Andy_L_J18-Sep-10 13:07
Andy_L_J18-Sep-10 13:07 
AnswerRe: complex sql query Pin
Mycroft Holmes18-Sep-10 13:35
professionalMycroft Holmes18-Sep-10 13:35 
AnswerRe: complex sql query Pin
abhi29198419-Sep-10 0:23
abhi29198419-Sep-10 0:23 
GeneralRe: complex sql query Pin
Mycroft Holmes19-Sep-10 3:08
professionalMycroft Holmes19-Sep-10 3:08 
GeneralRe: complex sql query Pin
abhi29198419-Sep-10 4:45
abhi29198419-Sep-10 4:45 
GeneralRe: complex sql query Pin
abhi29198419-Sep-10 5:46
abhi29198419-Sep-10 5:46 
QuestionINNER, OUTER, LEFT, RIGHT JOINs- totally confused. Pin
lemarshall18-Sep-10 6:57
lemarshall18-Sep-10 6:57 
I rried to post a little bit ago but that must have bombed off. I'm using Access 2007 in query design mode

At this point I have gotten to where I show the 24 test records for Material Inventory in the correct storage yards. The SQL statement is:
SELECT MatInv.MatInvID, Location.LocationName, MatInv.LocationID, MatInv.Units, MatInv.CostCenterID, MatInv.Condition, MatInv.TasksID, MatInv.MaterialsID, MatInv.CostCenterID, Materials.MaterialsID, Materials.Material
FROM Location INNER JOIN (Materials INNER JOIN MatInv ON Materials.MaterialsID = MatInv.MaterialsID) ON Location.LocationID = MatInv.LocationID;


Now I need to show where two 2 items of material in each storage yard came from a DIFFERENT CostCenterID than the CostCenterID of the storage yard. The storage yards are costed based upon the lease they are loacted on. There can be several hundred wells for each lease- all with the same CostCenterID. SOMETIMES, material from one well on one lease (one CostCenterID) may be stored in another leases storage yard (another CostCenterID). I need to be able to track it and point it out.

So I add in the table Well and relate the fields Well.CostCenterID to MatInv.CostCenterID and I get 36000+ records. Not the original 24 test records. So obviously the Query designer isn't what I need so I am trying to manipulate things in SQL view- STILL without any luck. Trying to follow info on Access help that is just about useless. Current SQL statement is:
SELECT Well.CostCenterID, Well.Well, MatInv.MatInvID, Location.LocationName, MatInv.LocationID, MatInv.Units, MatInv.CostCenterID, MatInv.Condition, MatInv.TasksID, MatInv.MaterialsID, MatInv.CostCenterID, Materials.MaterialsID, Materials.Material
FROM Well INNER JOIN (Location INNER JOIN (Materials INNER JOIN MatInv ON Materials.MaterialsID = MatInv.MaterialsID) ON Location.LocationID = MatInv.LocationID) ON Well.CostCenterID = MatInv.CostCenterID;

Any assisance is appreciated,
Larry
AnswerRe: INNER, OUTER, LEFT, RIGHT JOINs- totally confused. Pin
Mycroft Holmes18-Sep-10 13:32
professionalMycroft Holmes18-Sep-10 13:32 
GeneralRe: INNER, OUTER, LEFT, RIGHT JOINs- totally confused. Pin
lemarshall19-Sep-10 12:37
lemarshall19-Sep-10 12:37 
GeneralRe: INNER, OUTER, LEFT, RIGHT JOINs- totally confused. Pin
Mycroft Holmes19-Sep-10 12:44
professionalMycroft Holmes19-Sep-10 12:44 
QuestionSql queries on unicode data [modified] Pin
shiva.kore17-Sep-10 21:19
shiva.kore17-Sep-10 21:19 
AnswerRe: Sql queries on unicode data Pin
Rob Smiley17-Sep-10 23:57
Rob Smiley17-Sep-10 23:57 
GeneralRe: Sql queries on unicode data Pin
shiva.kore19-Sep-10 19:07
shiva.kore19-Sep-10 19:07 
QuestionOrdered selection of 2 columns in single SQL query Pin
Emmet_Brown17-Sep-10 19:44
Emmet_Brown17-Sep-10 19:44 
AnswerRe: Ordered selection of 2 columns in single SQL query Pin
i.j.russell17-Sep-10 22:35
i.j.russell17-Sep-10 22:35 
GeneralRe: Ordered selection of 2 columns in single SQL query Pin
Emmet_Brown18-Sep-10 0:28
Emmet_Brown18-Sep-10 0:28 
QuestionHow do I insert escape sequences using SQL Compact. Pin
Spawn@Melmac17-Sep-10 3:32
Spawn@Melmac17-Sep-10 3:32 
AnswerRe: How do I insert escape sequences using SQL Compact. Pin
Mycroft Holmes17-Sep-10 4:53
professionalMycroft Holmes17-Sep-10 4:53 
GeneralRe: How do I insert escape sequences using SQL Compact. Pin
Spawn@Melmac17-Sep-10 6:04
Spawn@Melmac17-Sep-10 6:04 
GeneralRe: How do I insert escape sequences using SQL Compact. Pin
Mycroft Holmes17-Sep-10 13:47
professionalMycroft Holmes17-Sep-10 13:47 
GeneralRe: How do I insert escape sequences using SQL Compact. Pin
Spawn@Melmac18-Sep-10 6:19
Spawn@Melmac18-Sep-10 6:19 
GeneralRe: How do I insert escape sequences using SQL Compact. Pin
Mycroft Holmes18-Sep-10 13:04
professionalMycroft Holmes18-Sep-10 13:04 
QuestionWhich version ODP.net is exactly required for oracle 11.2 and .net 2.0? Pin
padmanabhan N16-Sep-10 20:44
padmanabhan N16-Sep-10 20:44 
AnswerRe: Which version ODP.net is exactly required for oracle 11.2 and .net 2.0? Pin
Rob Smiley18-Sep-10 0:05
Rob Smiley18-Sep-10 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.