If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
ambiguous fields name
I use MS Access 2000 as front end, database is MS SQL 2000
as back end . I have 2 tables : [Student] and [Teacher] . I want to query whole student of a teacher (for example : "Peter") . I make a query that: Student(Code,Name,Description,TeacherCode) Teacher(Code,Name,Description) "Select * from dbo.Teacher INNER JOIN dbo.Student ON dbo.Teacher.Code=dbo.Student.TeacherCode" when I use [WhereCondition] in Docmd.OpenReport. I write Docmd.OpenReport "rptClass", acViewPreview, , " dbo.Teacher.Code='Peter' " It throws an error : "The column prefix 'dbo.Teacher' does not match with a table name or alias name used in the query" because there are 2 fields name is "Code" (one in Student Table and one is Teacher Table) so I have to use Table Name (to different them). Notes :I don't want to write (get from Student.TeacherCode) Docmd.OpenReport "rptClass", acViewPreview, , " dbo.TeacherCode='Peter' " Thank a lot |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ambiguous fields name | Minh Luan | Setting Up & Running Reports | 1 | August 12th, 2004 02:09 PM |
"UNION" Query with different fields in the two tables | Dkline | Running & Setting Up Queries | 5 | July 30th, 2004 09:05 PM |
How to ignore fields in Update Query | Casa | Running & Setting Up Queries | 6 | July 12th, 2004 12:46 AM |
Lookup fields on label report | Howard | Setting Up & Running Reports | 1 | June 3rd, 2004 02:43 AM |
Calculating fields for Access | Galin | New Users | 6 | May 5th, 2004 12:05 AM |