Problem using form-based-filter: ambiguous column name

Creating and using forms
Post Reply
julian
Posts: 19
Joined: Wed Apr 16, 2008 4:24 pm

Problem using form-based-filter: ambiguous column name

Post by julian »

I have a database schema with 2 tables with a same column name, Table1.dataNamefield and Table2.dataNamefield. Also I’ve a form with a text box whose datafield is one of the two columns mentioned previously. If I try to use a form –based filter putting a value in the text box appears the next error:

Data content could not be uploaded
[Microsoft] [ODBC SQL Server Driver] [SQL Server] ambiguous column name ‘X’

then I check the additional information of the error and I see query and I can see:
AND ( ( "dataNamefield" = 'value' ) ) There isn’t the name of the table ahead.

But when I created the query I specified the table

I also tried to put an alias in the query but also doesn’t work.
Is it a possible bug?
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Problem using form-based-filter: ambiguous column name

Post by Villeroy »

Create an alias for at least one of the ambiguous names.

Code: Select all

SELECT "Table1"."dataNamefield" AS "Alias 1","Table2"."dataNamefield" AS "Alias 2" FROM ...
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
julian
Posts: 19
Joined: Wed Apr 16, 2008 4:24 pm

Re: Problem using form-based-filter: ambiguous column name

Post by julian »

I've Create an alias for both of the ambiguous names, but still doesn't work
Post Reply