[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

Inner join inside a left join in crystal report wizard

hi, I wanted to know how do I insert this part of sql in a wizard report :

--JOIN FOR CO ROUTE
LEFT JOIN MVXCDTA.MWOHED AS MHEDR

INNER JOIN MVXCDTA.MITMAS AS MASTR ON
MASTR.MMCONO = MHEDR.VHCONO AND
MASTR.MMITNO = MHEDR.VHPRNO

LEFT JOIN MVXCDTA.MWOOPE AS OPE2 ON
OPE2.VOCONO = MHEDR.VHCONO AND
OPE2.VOFACI = MHEDR.VHFACI AND
OPE2.VOPRNO = MHEDR.VHPRNO AND
OPE2.VOMFNO = MHEDR.VHMFNO AND
OPE2.VOOPNO = 20
ON
MHEDR.VHCONO = ORD.OACONO AND
MHEDR.VHMFNO = (SELECT MAX(MHEDR2.VHMFNO)
FROM MVXCDTA.MWOHED AS MHEDR2
WHERE MHEDR2.VHCONO = ORD.OACONO AND
MHEDR2.VHRORC = 0 AND
MHEDR2.VHRORN = ORD.OAORNO AND
MHEDR2.VHPRNO LIKE '99%')

I thought about building a command near the report files, but I have an sql Expresion!!!

0
louisgh
Asked:
louisgh
2 Solutions
 
mlmccCommented:
You can't insert SQL into a report.

You can use a COMMAND or build a view/stored procedure in the database.

mlmcc
0
 
louisghAuthor Commented:
Ok , I Solved it ..I built a command subreport and linked the fields with my report!!

thnx anyway :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now