on 09-16-2008 6:58 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.