J
jwhal
Guest
Hi there. I'm trying to create a query (or two) that I can use to produce a spreadsheet but I'm having a bit of trouble. I'm using Access 2000. I've attached a pdf showing the relationships, that way you can see the whole db.
The fields I need for the spreadsheet are to be extracted from tables "Intrusive Manhole Survey" and "Pipe_information". The required fields are:
PipeID, Firm, Inspector, Sewer System, Source, Upstream Manhole ID, Downstream Manhole ID, pipe material, Pipe shape, Upstream Invert, Downstream Invert.
The upstream and downstream inverts are to come from "Depth of Pipe"....meaning the depth of pipe where pipe_information.upstreammanholeid=intrusive manhole survey.manholeid will be the upstream invert, and the depth of pipe where pipe_information.downstreammanholeid=intrusive manhole survey.manholeid will be the downstream invert. (see table below for example data)
Some pipes have two entries (because one pipe connects to two manholes, thus two entries).
Some pipes only have one entry (I'm working with four db's, so some pipes are spread across different db's, but I'm not worried about that yet).
In my pipe_information table, I have entries like this:
PipeInfoEntryID, IntrusiveEntryID, Pipe ID, Upstream, Downstream, Pipe Material, Pipe Shape, Pipe Diameter (mm), DepthofPipe
10 4 7493 878147 200002 RCP Circular 1350 23.16
9 3 21003 200004 200005 RCP Circular 750 22.37
6 2 21004 200003 200004 RCP Circular 750 22.81
8 3 21004 200003 200004 RCP Circular 750 22.37
7 2 21005 200002 200003 RCP Circular 750 22.81
12 4 21005 200002 200003 RCP Circular 750 23.35
11 4 21007 200002 878148 RCP Circular 1350 23.13
For example, the entry for pipe 21004 should look like:
21004, <date>, <firm/inspector>, <sewer>, <source>, 200003, 200004, RCP, Circular, 750, 22.81, 22.37
Note that fields shown as <fdkd> means the data comes from the Intrusive Manhole Survey table.
I also need to make sure it grabs pipes that only have one entry in the table. Is this possible?
If anyone needs more info, please email me.
I've tried different techniques, but to no avail. Make-table, then update; query of two queries, etc...I have a little bit of exposure to SQL, but nothing great. I've made sure that all fields are the same (but I still get validation errors) and so on and so forth. Whew. Hope someone can help me.
Please see the attached pdf for the relationships.
The fields I need for the spreadsheet are to be extracted from tables "Intrusive Manhole Survey" and "Pipe_information". The required fields are:
PipeID, Firm, Inspector, Sewer System, Source, Upstream Manhole ID, Downstream Manhole ID, pipe material, Pipe shape, Upstream Invert, Downstream Invert.
The upstream and downstream inverts are to come from "Depth of Pipe"....meaning the depth of pipe where pipe_information.upstreammanholeid=intrusive manhole survey.manholeid will be the upstream invert, and the depth of pipe where pipe_information.downstreammanholeid=intrusive manhole survey.manholeid will be the downstream invert. (see table below for example data)
Some pipes have two entries (because one pipe connects to two manholes, thus two entries).
Some pipes only have one entry (I'm working with four db's, so some pipes are spread across different db's, but I'm not worried about that yet).
In my pipe_information table, I have entries like this:
PipeInfoEntryID, IntrusiveEntryID, Pipe ID, Upstream, Downstream, Pipe Material, Pipe Shape, Pipe Diameter (mm), DepthofPipe
10 4 7493 878147 200002 RCP Circular 1350 23.16
9 3 21003 200004 200005 RCP Circular 750 22.37
6 2 21004 200003 200004 RCP Circular 750 22.81
8 3 21004 200003 200004 RCP Circular 750 22.37
7 2 21005 200002 200003 RCP Circular 750 22.81
12 4 21005 200002 200003 RCP Circular 750 23.35
11 4 21007 200002 878148 RCP Circular 1350 23.13
For example, the entry for pipe 21004 should look like:
21004, <date>, <firm/inspector>, <sewer>, <source>, 200003, 200004, RCP, Circular, 750, 22.81, 22.37
Note that fields shown as <fdkd> means the data comes from the Intrusive Manhole Survey table.
I also need to make sure it grabs pipes that only have one entry in the table. Is this possible?
If anyone needs more info, please email me.
I've tried different techniques, but to no avail. Make-table, then update; query of two queries, etc...I have a little bit of exposure to SQL, but nothing great. I've made sure that all fields are the same (but I still get validation errors) and so on and so forth. Whew. Hope someone can help me.
Please see the attached pdf for the relationships.