• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 530
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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