Link to home
Start Free TrialLog in
Avatar of clcarlson
clcarlson

asked on

Resolve column ambiguity in Infomaker

After trying to join two tables I'm getting an ambiguity error. As far as I can see, I've used the table name with the column name throughout the query. Is there some way to identify the offending statement?
Avatar of j_coreil
j_coreil
Flag of United States of America image

Post the SQL and we might can find it. That error typically means that you are referencing a column in the select statement that could come from two or more tables in the from statement.

Select a.First_Name,
           b.First_Name
From   employees a, spouses b
Where a.spouse_id = b.spouse_id;

If you alias the tables make sure you use the alias throughout the query as well.
Avatar of clcarlson
clcarlson

ASKER

Following is the query. I'm VERY new at this and, unfortunately, don't yet understand a lot of the syntax. I've tried to find a resource on point, but haven't had a lot of luck. Any suggestions would be appreciated. Thanks.

SELECT "GL_TRANSACTION_VIEW"."GLPOSTINGDATE",  
         "GL_TRANSACTION_VIEW"."TIMESTAMP",  
         "GL_TRANSACTION_VIEW"."AFTERCLOSEFLAG",  
         "GL_TRANSACTION_VIEW"."AMOUNT",  
         "GL_TRANSACTION_VIEW"."SOURCENAME",  
         "GL_TRANSACTION_VIEW"."GLACCOUNTID",  
         "GL_TRANSACTION_VIEW"."GLACCOUNTNAME",  
         "GL_TRANSACTION_VIEW"."USERNAME",  
         "GL_PACK".DebitAmt(amount) as "DR",  
         "GL_PACK".CreditAmt(amount) as "CR",  
         DP.Get('Report Date') as ReportDate,  
         DP.Get('ReportTitle') as asTitle,  
         DP.Get('CompanyName') as asCompanyName,  
         Gl_Pack.GetRefNameNoDescr(GL_Transaction_View.GLTrxHdrIdx, GL_Transaction_View.GlTrxSeq) AS REF1 ,  
         "GL_TRANSACTION_VIEW"."SOURCEIDX",
         "CA_TRANSACTION_VIEW"."COSTCENTERNAME",
         "CA_TRANSACTION_VIEW"."PHASENAME"  
    FROM "GL_TRANSACTION_VIEW",
         "CA_TRANSACTION_VIEW"
   WHERE ("GL_TRANSACTION_VIEW"."ACRUCASHTYPE"="CA_TRANSACTION_VIEW"."ACRUCASHTYPE") AND
         ("GL_TRANSACTION_VIEW"."FISCALYEAR"="CA_TRANSACTION_VIEW"."FISCALYEAR") AND
         ("GL_TRANSACTION_VIEW"."FISCALPERIOD"="CA_TRANSACTION_VIEW"."FISCALPERIOD") AND
         ("GL_TRANSACTION_VIEW"."GLPOSTINGDATE"="CA_TRANSACTION_VIEW"."GLPOSTINGDATE") AND
         ("GL_TRANSACTION_VIEW"."USERNAME"="CA_TRANSACTION_VIEW"."USERNAME") AND
         ("GL_TRANSACTION_VIEW"."TIMESTAMP"="CA_TRANSACTION_VIEW"."TIMESTAMP") AND
         ("GL_TRANSACTION_VIEW"."INITIALINSTALLATIONFLAG"="CA_TRANSACTION_VIEW"."INITIALINSTALLATIONFLAG") AND
         ("GL_TRANSACTION_VIEW"."AFTERCLOSEFLAG"="CA_TRANSACTION_VIEW"."AFTERCLOSEFLAG") AND
         ("GL_TRANSACTION_VIEW"."AMOUNT"="CA_TRANSACTION_VIEW"."AMOUNT") AND
         ("GL_TRANSACTION_VIEW"."SOURCEIDX"="CA_TRANSACTION_VIEW"."SOURCEIDX") AND
         ("GL_TRANSACTION_VIEW"."SOURCENAME"="CA_TRANSACTION_VIEW"."SOURCENAME") AND
         ("GL_TRANSACTION_VIEW"."SOURCEID"="CA_TRANSACTION_VIEW"."SOURCEID") AND
         ("GL_TRANSACTION_VIEW"."GLTRXHDRIDX"="CA_TRANSACTION_VIEW"."GLTRXHDRIDX") AND
         ("GL_TRANSACTION_VIEW"."GLTRXSEQ"="CA_TRANSACTION_VIEW"."GLTRXSEQ")
ORDER BY "GL_TRANSACTION_VIEW"."GLACCOUNTID" ASC,
                  "GL_TRANSACTION_VIEW"."GLACCOUNTNAME" ASC,
                  "GL_TRANSACTION_VIEW"."GLPOSTINGDATE" ASC,
                  "GL_TRANSACTION_VIEW"."TIMESTAMP" ASC
ASKER CERTIFIED SOLUTION
Avatar of flow01
flow01
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
AWESOME! You're hired. Thanks very much.