Skip to Content
avatar image
Former Member

exposed names

hi kings,

i get the error message in crystal report for using the below query.here i joined the oitm table in two times but its necessary so only i joined.when i am using the this query for crystal report its through the error"the objects'oitm' and 'oitm' in the from clause have the same exposed names.use correlation names to distinguish them.....

SELECT '42', "oign"."DocNum", "oign"."DocDate", "ign1"."ItemCode", "ign1"."Dscription" ItemName, "ign1"."Quantity" , Convert(numeric(20,2),"wor1"."u_pr"), Convert(numeric(20,2),("wor1"."u_pr"*"ign1"."quantity")), "ign1"."U_UBundletoKg", "oitm"."invntryuom", '', "oign"."WhsCode" FROM "OIGN" T0 INNER JOIN "IGN1" T1 ON "oign"."DocEntry "= "ign1"."DocEntry" inner join "OWOR" T2 on "ign1"."Baseentry" = "owor"."docentry" inner join "wor1" t4 on "owor"."docentry" = "wor1"."docentry" inner join "oitm" t3 on "wor1"."itemcode" = "oitm"."itemcode" left join "oitm" t5 on "ign1"."itemcode" = "oitm"."itemcode" WHERE "owor"."DocNum" = '[%0]' and "ign1"."trantype" = '' and "oitm"."invntitem" = 'N'

Thanks & best regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 16, 2008 at 06:26 AM

    When you use an Alias with a table name you should use the same Alias in the Joins

    Example in this highlighted portion of SQL use T3.ItemCode where you use T3 for OITM and in the second instance use T5.ItemCode

    "oitm" t3 on "wor1"."itemcode" = "oitm"."itemcode" left join "oitm" t5 on "ign1"."itemcode" = "oitm"."itemcode" WHERE "owor"."DocNum" = '%0' and "ign1"."trantype" = '' and "oitm"."invntitem" = 'N'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 16, 2008 at 06:42 AM

    The alias are for you to identify tables. When different alias assigned to the same table, system will treat them separately. Therefore, you need to replace both oitm with T3 or T5 in the inner join clauses.

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded