If this correct use of Select

Hi there

I want to use the following statement in the RowSource for a report but am 
unsure of whether it's correct:

SELECT *, *
FROM T_Participants RIGHT JOIN T_General ON T_Participants.[Student_ID] = 
T_General[StudentID_FK]; 

Does this look correct to anyone?

Thank you in advance for your help.
0
Utf
6/5/2010 2:29:32 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

3 Replies
1148 Views

Similar Articles

[PageSpeed] 0

On Fri, 4 Jun 2010 19:29:32 -0700, forest8 <forest8@discussions.microsoft.com>
wrote:

>Hi there
>
>I want to use the following statement in the RowSource for a report but am 
>unsure of whether it's correct:
>
>SELECT *, *
>FROM T_Participants RIGHT JOIN T_General ON T_Participants.[Student_ID] = 
>T_General[StudentID_FK]; 
>
>Does this look correct to anyone?

Not really. The SELECT * syntax means to select all fields (from all tables);
so by using the asterisk twice you're saying SELECT each field twice. I expect
Access will assign an alias fieldname to one of the duplicates. The RIGHT JOIN
will cause all records in T_General to be included, whether or not they have a
match in T_Participants; if they do have a match you'll get all the field
values in T_Participants, otherwise those fields will be in the report's
recordsource with NULL values.

Could you explain what fields are in the two tables, and what you intend this
query to accomplish?
-- 

             John W. Vinson [MVP]
0
John
6/5/2010 5:54:27 AM
I was planning on using the select in the rowsource of a report.



"John W. Vinson" wrote:

> On Fri, 4 Jun 2010 19:29:32 -0700, forest8 <forest8@discussions.microsoft.com>
> wrote:
> 
> >Hi there
> >
> >I want to use the following statement in the RowSource for a report but am 
> >unsure of whether it's correct:
> >
> >SELECT *, *
> >FROM T_Participants RIGHT JOIN T_General ON T_Participants.[Student_ID] = 
> >T_General[StudentID_FK]; 
> >
> >Does this look correct to anyone?
> 
> Not really. The SELECT * syntax means to select all fields (from all tables);
> so by using the asterisk twice you're saying SELECT each field twice. I expect
> Access will assign an alias fieldname to one of the duplicates. The RIGHT JOIN
> will cause all records in T_General to be included, whether or not they have a
> match in T_Participants; if they do have a match you'll get all the field
> values in T_Participants, otherwise those fields will be in the report's
> recordsource with NULL values.
> 
> Could you explain what fields are in the two tables, and what you intend this
> query to accomplish?
> -- 
> 
>              John W. Vinson [MVP]
> .
> 
0
Utf
6/6/2010 2:50:04 AM
On Sat, 5 Jun 2010 19:50:04 -0700, forest8 <forest8@discussions.microsoft.com>
wrote:

Fine; what's in the table, and what do you want to see in the report? 

Remember *you* can see your database. I cannot.

>I was planning on using the select in the rowsource of a report.
>
>
>
>"John W. Vinson" wrote:
>
>> On Fri, 4 Jun 2010 19:29:32 -0700, forest8 <forest8@discussions.microsoft.com>
>> wrote:
>> 
>> >Hi there
>> >
>> >I want to use the following statement in the RowSource for a report but am 
>> >unsure of whether it's correct:
>> >
>> >SELECT *, *
>> >FROM T_Participants RIGHT JOIN T_General ON T_Participants.[Student_ID] = 
>> >T_General[StudentID_FK]; 
>> >
>> >Does this look correct to anyone?
>> 
>> Not really. The SELECT * syntax means to select all fields (from all tables);
>> so by using the asterisk twice you're saying SELECT each field twice. I expect
>> Access will assign an alias fieldname to one of the duplicates. The RIGHT JOIN
>> will cause all records in T_General to be included, whether or not they have a
>> match in T_Participants; if they do have a match you'll get all the field
>> values in T_Participants, otherwise those fields will be in the report's
>> recordsource with NULL values.
>> 
>> Could you explain what fields are in the two tables, and what you intend this
>> query to accomplish?
>> -- 
>> 
>>              John W. Vinson [MVP]
>> .
>> 
-- 

             John W. Vinson [MVP]
0
John
6/6/2010 8:17:46 PM
Reply:

Similar Artilces:

Using the sum function in a 3 dimension environment
How to Use the sum function in a 3 dimension environment in Microsoft Excel? Need a detailed description for a research paper I am doing, ASAP!!!! Is this what you need? =SUM(Sheet1:Sheet3!C1) If sheet names have spaces use =SUM('sheet x:sheet y'!C1) -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Paul Hargreaves" <Paul Hargreaves@discussions.microsoft.com> wrote in message news:24F4CEEA-3A12-4922-B72B-416A9584EDD6@microsoft.com... > How to Use the sum function in a 3 dimension environment in Microsoft > Excel? > Need a detailed d...

Dating using workdays
Is there a way to autofill dates into a spreadsheet and only use workdays and not Saturdays and Sundays? no Depending on version yes, put the first date in a cell, right click the cell and copy it down, when you release the mouse button you can select weekdays.. -- Regards, Peo Sjoblom "Bill" <anonymous@discussions.microsoft.com> wrote in message news:012a01c3d543$6c197a40$a301280a@phx.gbl... > no You could try this. Put a non weekend-date in A1 Put this formula in A2 =IF(WEEKDAY(A1)=6,A1+3,A1+1) Copy it down -- HTH Bob Phillips ... looking out across Poo...

load an existing buffer using IXMLDOMDocument
Hi Experts: Is there a way to load an existing buffer (an XML file) using IXMLDOMDocumentPtr->load()? I know it works for loading an XML file, but I need to load an existing buffer with known length. Thanks In Advance! Polaris Try loadXML instead. Thanks, that worked! Is there a way to dump the current contents of IXMLDOMDocument to a buffer in memory (not a file) ? "save" does not work, it always think the buffer I passed to it is a file path. I'm trying not to use IStream. Thanks Polaris "Truong Hong Thi" <thi1981@gmail.com> wrote in message ...

Excel Pivottable using data in Access 2002
I have been using Access 2000 to hold tables with lots ( 200,000 rows ) of data. In Access 2000 you can make a Pivottable Form which starts Excel and really makes the pivottable there although the data actually stays in Access. Works great. I've recently gotten Access 2002 which tries to make the Pivottables itself. It's not as good. I want this new verson of Access to work with Excel like the old version. This new verson offers to let me "export" the pivottable, but that tries to start Excel and copy the data in and there's too much data for it to be able to do tha...

Input a date using a Form Button.
Hi, Please help as I'm totally lost with this one! I'm doing a little project for work and I have come across a littl problem with a date input that I have set up using a Form Button. No this button once pressed enters the date just as I want, into th correct Cell (the buttons called "Todays Date") Now I have recorded macro so that the button executes the =TODAY() comand - which is fin untill the date changes!! As you can emagine I need the date to stay a it was when first pressed as its a database I'm trying to compile. Does this make any sense to you all?? I will...

Reference Grouped Objects Using VBA
Hello I have grouped four charts, three text boxes (from the control toolbox) and a rectangle. Prior to grouping, the code I had to update the axes on both charts and text for the text boxes worked fine. After grouping the objects the code fails. How do you reference a specific object contained in a group? If Shp is a grouped shape then Shp.GroupItems(2) references the second shape in the group -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware .. "BJ" <bradley.john@westrac.com.au> wrote in message Hello I have grouped four charts, three text ...

Use Pivot Table to Populate another table dynamically
Hi, I have a pivot table that is pulling from a large table of data with hours and projects for various clients and hours etc. I want to create an invoice that is populated dynamically with the hours and project as they change by client depending on the client filter. Is there anyway to do this? Everything I have tried has not been dynamic. Thanks ...

Can't intall Exchange 2003 SP1 using /disasterrecovery switch
Hi, I am testing a disaster recovery on my test environment. My domain is a Windows 2003 child domain, therefore my Exchange 2003 SP1 also in an administrative group (meaning, I don't have permission at Org level). I reinstalled the Windows 2003, restored the system state, applied hotfixes and then successfully reinstalled Exchange 2003 in disaster recovery mode. However, when I tried to install the Exchange SP1 using disaster recovery I failed, I got error message that "Exchange Messaging and Collaboration Services can not be assigned disaster recovery switch. Because: This is the...

Calculating page/report sums using calculated data from subquery
Here is a scenario from my report: The report will grab data with a main query into a parent row Depending on the data, a child row may exist, if it does the report will display it The child row will use data from the parent row in order to do a calculation in the child All of this works just fine and the report data is correct. Now, what I am having issues with is doing the page/report sum calculations. The requirements dictate that I need to create a sum of both the parent column and also the child column in the totals. I have been trying to do this all day and cannot see...

Which formula should I use.....
Hi there, I'm building a contract, and I need specific cells from each page in the workbook to total up on a pricing sheet (still in workbook). I've tried using IF commands to build this mammoth equation, it just isn't working. I'm getting quite frustrated, I've been working on this for a few weeks. I'm new to such detailed formulas in Excel, and any help anyone could give me would be greatly appreciated!! Thank you!!!! Heather -- HeatherCox ------------------------------------------------------------------------ HeatherCox's Profile: http://www.excelforu...

Using the primary key in an autonumber
Hi there, Needing some help with trying to generate and display an incrementing auto number on a form. I have scoured some of the forums but haven't had any luck with getting such a simple thing to work. I have a student database which I am trying to create a unique student ID number based on a set prefix each time I go to add a new student. For example: Student ID - ABC 09 1 Where ABC = set prefix 09 = the current year 1 = would represent the autonumber (primary key) The only luck I have been having with getting this to work is entering the following syntax in the...

Run macro on selected sheets
Hi I have a workbook with 103 sheets, I want a macro to run on 100 of the sheets. Here is the macro, can anyone help me with this? Sub ReconsileStockCard() Range("D3").Select ActiveCell.FormulaR1C1 = "=SUM(R[4]C[-2]:R[97]C[-2])" Range("D3").Copy Range("B7").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Range("A7:A36,B8:B36").ClearContents Range("D3").ClearContents Range("D7").ClearContents...

Using ZwCreateProcess
Hello, I am trying to call ZwCreateProcess defined in the Windows DDK, and I was curious how I would go about using this to create a process. I cannot find the parameter in which I provide the path to the executable I would like to run. Thanks Why? Seriously, there needs to be a good reason. The undocumented API has its valuable uses, but I'm not sure why ZwCreateProcess would be among them (the most common use of the undocumented API is to get functionality not normally available in the WIn32 API, but CreateProcess already exists). I note that in the WIndows DDK I can't find...

How do I use excel with simply accounting
I would like to make a daily cash sheet In excel where I can enter data which I can then import into Simply accounting as a general journal entry. Is this possible and if so how -- If you could help I'd be grateful Dar I haven't used Simply Accounting, so I don't know the exact answer. There's probably some Simply Accounting who can answer. Nevertheless, thought I would comment. Have you looked Simply Accounting's built-in Help and searched for info in importing data? If it can be done, the info should be in Help, and it would probably give detailed instructions o...

use IUrlHistoryStg2 to get the history record,but how to get the user name ?
IUrlHistoryStg2 can tell you the url,titile,some visited time information.But how can I know who visit this url ? Anyone can give me some hint or code ? Thanks very much ...

Datagridview selected rows
I want to get the first selected row of DataGridView Selected Rows. The goal is that I would hold down CTRL or SHIFT and select multiple rows, then I could click a button or menuitem and update all selected rows with a value from the first selected row. For example in crystal reports you hold down shift and click multiple control and select Same Width and it resizes all to Width of the first one you clicked. Datagridview seems to works if you the select in order going down the grid, but from bottom to top its different. If I could find out the direction, then i could take the first ...

Using Defined Names in Charts
I am using Office 2002. I am trying to create a chart that has only one Series called Data. The values for DATA is a name called SCROLL_DATA. The name has been defined using the Insert-Name-Define action. The workbook is called Quality Escapes.xls I have entered the following in the values box as I have seen many instruction as follows =Quality Escapes.xls!SCROLL_DATA What am I doing wrong. -- bobburg ------------------------------------------------------------------------ bobburg's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=22006 View this thread: http:/...

Change Organization name and use exisiting CRM DB
I did a search on this could not find it here. We need to change the organization name and be able to re-use the data which is already in the CRM Database. Is this going to work? what are the steps? I know probably the redeployment is one way. correct? any other way? The original CRM key and org-name was MSDN and the new one is "official" Microsoft issued license with the legal company name. Thanks for any suggestions. Regards Max Sounds like this is for v1.2. In that case, the Redeployment Tool is the only way to go. There are too many ties between the DB and AD in v1.2. -...

Using ajaxToolkit:AnimationExtender in a content page
In Default.aspx I want to move a Table that is in the .Master file. I tried the following even though I didn't expect it to work; and it didn't. <%@ MasterType VirtualPath="~/Main.master" %> <asp:Content ID="Content0" ContentPlaceHolderID="TopImageCPH" runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"/> <ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="Master.TableTop"> <Animations> <...

Excel Function for select data which NOT exist from the list
There are 2 data sets are assumed running in A3 and in B3 down, viz.: In A3 down is: A, B, C, D, E, F, G, H, I, J, K and L In B3 down is: B, A, H, C, F, I, K, J, H, C and J. The result which I want is to list or select the data which is NOT exist in the second set of data (Col B) when compare to the first set of data. In my example, the result is D, E, G, and L actomactic appear in cell C3, C4, C5 and C6 accordingly. I need an Excel formula to have this result! Many thanks, Wilchong -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/excel-new/200804/1 Try thi...

Multiple selection in the page area of a pivot table
Is there any way i can have multiple selection check boxes in the page area of a pivot table? ...

Excel 2003 doesn't filter correctly
All of a sudden I can't filter a colum correctly. I use filtering to find records that have been "started", "done", "cancelled", "paid", etc. I have made sure that the colum is formated for text. When I use the filter I get other unwanted records in addition to my filter request. This seems to only be happening on a summary sheet in 1 workbook. The other sheets seem to filter just fine. I have had no problem for the last 6 months using filters with this workbook until recently. Does anybody else have this situation? Do those extra thing...

How do you name and use a custom Layout
I have a spreadsheet with 30 coloumns. Differnt users access this spreadsheet and depending on their login name I wanted to display a different layout for differnt users. I have tried using custom view but it does not work. I tried cutting and inserting the cut colomn into a differnt part of the spreadsheet and named the custom view, but it did not go to it from the default layout. In other words it appears you cannot use custom views to view different layout options -- Steve F Not sure how you are going to tell the system the login name. But the custom views should work. I start with...

Identities and correct mail receival
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3353490050_1290362 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Hi I have Entourage 2004 and have 2 identities. The problem is that incoming emails are delivered to the wrong identity mail box. All messages are going to the main identity. I have checked the identity settings and can not see anything a miss. There are no rules active re this issue Help Help!!! --B_3353490050_12903...

mutli-select list box problem
The following code is my failed attempt to get the items picked in a multi-select List box to then appear in another form named "NameDetailForm". The NameDetailForm does open but does not show the items picked from the list box. I believe the end part of my code is flawed, but cannot figure out what it should correctly be. If there is better code for this purpose, I would appreciate seeing it. Private Sub Itemschosen_Click() Dim strWhere As String, varItem As Variant If Me!NameListBox.ItemsSelected.Count = 0 Then Exit Sub For Each varItem In Me!NameListBox.ItemsSelec...