Pass thru - Select from two tables joined on three fields

In a Pass thru query, I want to select the meter_number, acct_period, 
prod_period, dth from the dbo.con_vols table and the mcf and btu from the 
dbo.meas table where the meter_number, acct_period and prod_period are equal 
to the meter_number, acct_period and prod_period in the dbo.con_vols table.

Can anyone help, please?  I know I need an INNER JOIN, but am not sure how 
to do that.

Thank you in advance!
0
Utf
8/6/2007 4:48:01 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
772 Views

Similar Articles

[PageSpeed] 47

On Mon, 6 Aug 2007 09:48:01 -0700, Liz C <LizC@discussions.microsoft.com>
wrote:

>In a Pass thru query, I want to select the meter_number, acct_period, 
>prod_period, dth from the dbo.con_vols table and the mcf and btu from the 
>dbo.meas table where the meter_number, acct_period and prod_period are equal 
>to the meter_number, acct_period and prod_period in the dbo.con_vols table.
>
>Can anyone help, please?  I know I need an INNER JOIN, but am not sure how 
>to do that.
>
>Thank you in advance!

SELECT  dbo_con_vols.meter_number, dbo_con_vols.acct_period,
dbo_con_vols.prod_period, dbo_con_vols.dt,dbo_meas.mcf, dbo_meas.btu 
FROM dbo_con_vols INNER JOIN dbo_meas
ON dbo_con_vols.meter_number =  dbo_meas.meter_number
AND dbo_con_vols.acct_period =  dbo_meas.acct_period
AND dbo_con_vols.prod_period =  dbo_meas.prodt_period;

             John W. Vinson [MVP]
0
John
8/6/2007 6:06:41 PM
Reply:

Similar Artilces:

Passing Criteria to a Pivot Table from combo boxes
Hi, I have done something similar in the past but not quite the same as this. I have a worksheet which has 8 different criteria I need to pivot on. I have a front sheet with 8 combo boxes on it (for the end user to select criteria) and need to pass these values to a pivot table, which in turn outputs various graphs etc from the data returned by the pivot table. The pivot table and graphs work fine but I don't know how to pass the combobox values to the pivot table. Any advice or pointers would be greatly appreciated. Many thanks In one of my models I use a Lis...

Pivot table sort order
Hello, My pivot table (on a seperate sheet in V2003) seems to sort my data in an entirely random order. It is not in the order that the iems appear in the original data, and it is not in size or alphabetical order, and what's more, I can't change the order, even if I use 'Sort & Top 10' or Advanced 'Field Settings. Why is this? How can I determine the order? - Ideally it would be in the order tht the iems appear, but if that's not possible, I could fiddle it, if I could sort it at all! Thanks M My observation was that tinkering with 'Sort & Top 1...

link two cells
can anybody tell me a good way to link cells on two different worksheet to each other so that when the user clicks on a cell/button on sheet 1 he/she will automatically be taken to a certain cell in sheet2? I am using hyperlinks for that at the moment, but updating(for exampl when the name of sheet2 changes) them is a real pain, because one ha to go through each hyperlink individually... thanks for any help -- Message posted from http://www.ExcelForum.com David McRitchie posted this and it might help you: =HYPERLINK("#"&CELL("address",C5),C5) =HYPERLINK("...

Counting Table (By Date)
Is there a way to make an table/query in Access that counts by date? For example, if I have multiple projects with different start dates, I'd like to have a running count of the months for the project... e.g. Start Date 02/28/2010 03/1/2010 05/31/2010 Project A B C Date 1/2010 0 0 0 2/2010 1 0 0 3/2010 2 1 0 4/2010 3 2 0 ...

How to set up two accounts with one brokerage?
I am using MS Money 2003. I have two accounts with one online brokerage. One is my 401k and one is just some stocks. In order to log in, I have to use a different user name and password depending which account I want to access. The problem is, MS Money only allows me to enter one user name and password for each brokerage. I change the online properties of each MS Money account one at a time, but the changes do not stick. Both accounts wind up with the user name and password of the account I changed last? Am I doing something wrong? Any help would be appreciated. In microsoft...

assigning value to a column based on a table of values
I am correcting an exam and I have automatically generated the score of the students. These I have in columns. Further I have a translation code that showes how a score relates to a grade. this is shown below. Here the interval from min to max is the score that produce the grade. For example if the score is between 2 and 5 the grade is 5. How do I make the translation from score to grade automatically? min max grade 0 2 3 2 5 5 5 6 6 6 7 7 7 8 8 8 11 9 11 18 10 18 23 11 Jacob Just use =VLOOKUP(E1,B2:C9,2) where E1 holds the score to be graded, B2:C9 holds the max and grade columns. ...

Pivot tables, linking to a named range as a source to a pivot table
I have created a main worksheet within the same workbook of many pivot tables, and I want to use this same worksheet as the source of information to these different pivot table sheets off of which I create charts. I want to use a named range because there are over 4,000 rows in this main worksheet. I am not sure if I need a "=" to start the reference or what to do. I thought I should just use nameofworksheet!database if I name the range "database", but when I point and click to the sheet, it is just inserting the name "database" without the name of the...

Multiply two series and add results
I have a large workbook with many sheets for each charge number on a project. I had to copy and paste a sheet into the workbook and am trying to remove the links to the original workbook. I have, in addition to the sheet for each charge number, a sheet with pay rates for each person. I need to multiply two columns of information together: the hours for each person * the pay rate for each person. The formula that was in the sheet (and on every single other sheet in the chart) is this: =SUM(C3:C24*'Costs'!$C3:$C24) (With 'Costs' being the sheet with payrates on it.) This formu...

i get a message too many fields defined on ACCESS
Trying to add columns, and it does not let me. What can I do Ibz´┐Żn wrote: > Trying to add columns, and it does not let me. > > What can I do I believe the limit is 255, but you may need to do a compact and repair (see top line menu) to free up previously deleted fields. If you are anywhere over about 30 or 40 fields, you likely need to revise your table design and "Normalize" it. -- Joseph Meehan Dia 's Muire duit ...

Table format
Hi When I run the code below I get "External table is not in the expected format" error at line rsData.Open sSQL, sConnect, adOpenForwardOnly, adLockReadOnly, adCmdText Option Explicit Public Sub SelectFromAccess() Dim rsData As ADODB.Recordset Dim sPath As String Dim sConnect As String Dim sSQL As String 'Clear the destination worksheet Sheets(1).UsedRange.Clear 'Get the database path (same as this workbook) sPath = ThisWorkbook.Path If Right$(sPath, 1) <> "\" Then sPath = sPath & "\" 'Create the connection s...

run two queries from one click?
This has to be easier than I'm making it. I have a form with these fields: TaskID - number Task Description - text Month Completed - text list pulled from a query Year Completed - text list pulled from a query Category - text list pulled from a query, can be more than one category per task Task Description - memo Now what I want to do is... insert TaskID, Description, Month Completed, Year Completed and Description in one table AND insert TaskID and each Category into another table with a single button click to make it easy for users. As stated above, there can be more than one cate...

Consolidated view of two exchange account calendars
Hello All, Is it possible to obtain a consolidated view of two exchange account calendars within Outlook 2003? I am using two different exchange emails (e.g., ira.kovac@microsoft.com and ira.kovac@ibm.com - different domains, different servers) which are accessed via two different outlook profiles set on the same XP machine. Thanks for your help. Ira Random Link Rotator: ----------------------------------------------------------------- Ski Dubai Kosten: http://www.skifahrendubai.com/kosten.html ----------------------------------------------------------------- No. Not with different ...

Adding two days of data on one row
Hi, Here is the issue. I am using Access 2003. I am in a central time zone and I run a report that is in Pacific time zone. When I export this data it shows all of the data for yesterday and then goes into two hours today. For example: The report that i run is from 2:00 am CST which would be 12:00 PST on 1/28/2008 to 1:59 am CST which would be 11:59pm PST on 1/29/2008. When this report is exported I am showing data essentially from 2:00 on 1/28 to 1:59 on 1/29. Since I have data for two days I need to get a total for three colums. I then need to calculate a formula based on that inform...

Unmatched Query -- Fields do not appear
I'm trying to construct an unmatched query and for some reason, suddenly when I get to the part of the wizard where it allows me to select the fields on which to do the compare, no fields appear. Perplexing. Any ideas? On Aug 1, 5:50 pm, pdlginter...@aol.com wrote: > I'm trying to construct an unmatched query and for some reason, > suddenly when I get to the part of the wizard where it allows me to > select the fields on which to do the compare, no fields appear. > Perplexing. Any ideas? Your wizard is screwed up. Do it by hand... it's just an outer join. Say you ha...

Dynamically changing several pivot tables at once
I have several pivot tables within one spreadsheet. All pivot tables have the exact same criteria within the drop downs (eg. country, region, city). The "data" presented in each pivot table is different (eg. revenue, gross profit, net income). Is it possible to link all pivot tables so when a user changes, for example, the country in one pivot table, it updates all other pivot table data with the selected country values? I appreciate any help you may have. Regards, Jason Check this website and run the "- Synchronize 2 Pivot Tables with a Combo Box" tutorial: h...

Two years of Errors and Omissions...
I just saw as I added some new material this evening, that in two years, I and several contributors have identifed <<<470>>> errors in the Microsoft documentation. I expect to actually add a few more this evening, because I'm reading the Assembler, well, it is hard to dignify the piece of trash that has been foisted off on us as "Documentation", but, perhaps I might say, I'm reading the Assembler Imitation Reduced-Fat Documentation Product*. Catch this: ============================================================ operator OPATTR OPATTR expres...

calculation of future value between two dates
HELP please. I am trying to find an easy / short way to calculate future value of a lump sum amount between two dates. The info I will have :- 1. Amount (say $1000 ) 2. Start date of deposit (1st jan 2008) 3. Date to which future value is to be calculated to (1st may 2010) 4. Interest rate ( fixed 10%) 5. Compounded semiannualy. How can I create a formulae to calculate this in one swoop ? "manas123" <manas123@discussions.microsoft.com> wrote: > How can I create a formulae to calculate this in one swoop ? For an approximation: =FV(10%/2, DATEDI...

Two "getting started" questions from a newcomer.
Two questions 1. When I open Outlook, it doesn't automatically bring up my dialer to access my mail, as does Outlook Express. In other words, whenever I click on my Express shortcut, my dialer appears, permitting me to dial up and check my mail. But when I click on the Outlook shortcut, the program opens, but then I have to call the dialer up separately 2. When Outlook opens, I always see this window labeled Microsoft LDAP Directory. It doesn't matter whether I click "okay" or "cancel," because nothing seems to happen. How do I stop this window from popping ...

"client last name" & client table "last name" same info-join?how
Access job table has "client last name" & client table has "last name". same data different name. when i try to join relationship nothing happens with the data. it is not sharing data for last name.??? Are you sure you want to do that? How many "Smith" or "Jones" or "Fernandes" or "Ivanov" entries might there be in a job or a client table? Joining on "last name" is not a good idea... -- Regards Jeff Boyce Microsoft Access MVP Disclaimer: This author may have received products and services menti...

Resource Groups and Selection Rules
Is it possible to do the following? If it is, how do I structure the selection rules? I want to create a resource group for each type of certification that technicians/engineers have (for example, MCITP). I then want to create services such will select engineers/technicians that have a specific set of certifications. Specifically, I may have a job that requires the technician/engineer to have three specific certifications. If I can help make this more clear, please let me know. I did see the following note on a blog that I found. I am hoping that it doesn't mean I can't do what ...

Select Distinct Question
I have a select distinct query that provides CustomerID Address City State Zip I need to add the Customer Name to the distinct list I created but here is the problem. This individual rows that roll up to make a distinct records may contain variations in the Customer Name thus creating duplicates. I guess Access as to have a distinct RECORD as opposed to a distinct field. Which Customer Name that get added to the list doesn't matter to me. How do I create a query that will just use the first Customer name it encounters when I link on CustomerID use group by instead of distinct a...

Pivot Table
Hi all, I have one issue when i get the data through the pivot table option. after creating a pivot table, i enabled the sub-total and the grand total in the pivot table properties. after enabling that the sub-total and the grand total columns appear as #VALUE!. I have office 2003 in OS 2000 proffesion. Please help me Regards Yazh I'd check for errors in the original data for that field. yazh wrote: > > Hi all, > I have one issue when i get the data through the pivot table > option. after creating a pivot table, i enabled the sub-total and the > grand total in...

Pivot Table Toolbar #3
When I right click in the tool bar area and try to include the pivot table tool bar no additional buttons appear but just a blank row in the tool bar area? I'm confused. Do I have a setting wrong in my Excel setup? I was hoping for some options that included the option to include formulas in my pivottable. -- thanks, mc Please disregard question - found my problem - I just needed to reset my buttons. -- thanks, mc "dallin" wrote: > When I right click in the tool bar area and try to include the pivot table > tool bar no additional buttons appear but just a bla...

retieving data from a sql table
Hi, I'd like to be able to automatically fill certain columns in excel with data from an SQL table. For example, I have a column called "item code" and I'd like the columns "item description" and "item cost" to be automatically retrieved from an SQL table when the user inputs the item code. I'm having trouble in two areas. One, getting it to perform automatically once the data is inputed, and filtering the records to include only the description and cost for that specific item code. I've tried using macros and the "Get External Data" in ...

Creating and updating a Table of Contents in MS Publisher 2003
Last year my department started using MS Publisher to create and update training materials for three call centers. One big drawback (the only one I've found so far!) is that unlike MS Word I have been unable to create an automatic Table of Contents, therefore, we've been creating them manually then updating them each time we need to update the materials (which is frequently). Isn't there some easier way to do this? -- Sharon As you have found out, Publisher does not support TOC. Word is more suitable for this. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http...