If this correct use of Select

  • Thread starter Thread starter forest8
  • Start date Start date
F

forest8

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.
 
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?
 
I was planning on using the select in the rowsource of a report.



John W. Vinson said:
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?
 
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 said:
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?
 
Back
Top