Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rebuild sql statement into crystal

Status
Not open for further replies.

patrick118

Technical User
Jan 14, 2004
315
NL
I have an rather large SQL statement and want to build a report with the same comditions. I do it with the select expert option and then try to make it the same. This is the statement. Now the problem lies in the point that i don't know how to do the select statement in the report.

WHERE A.AFWIJKING_ID=B.AFWIJKING_ID (+)
AND B.C_SRT_AFWIJKING=C.C_SRT_AFWIJKING (+) AND A.C_VERWEZEN_NAAR=D.C_VERWEZEN_NAAR
(+) AND A.C_SRT_AKTIE=E.C_SRT_AKTIE (+) AND A.CLIENT_ID=F.CLIENT_ID (+)
AND A.C_MEDEWERKER=3 AND A.HER_JAAR BETWEEN 2005 AND 2005 AND A.HER_MAAND
BETWEEN 10 AND 10 AND NVL(F.B_NOOIT_MEER_UITNODIGEN,0)=0 AND A.CLIENT_ID NOT
IN (SELECT C.CLIENT_ID FROM AGENDA C WHERE C.D_AFSPRAAK_VAN >
TO_DATE('20050825','YYYYMMDD') AND C.B_HERHALING=1 AND C.C_SRT_ONDERZOEK=211)
ORDER BY F.GESLACHTSNAAM;


Any help is great.
 
Use the database expert to link the records. For selection, use Report>Selection Expert>Record and use this to place selections like
Code:
C.D_AFSPRAAK_VAN > TO_DATE('20050825','YYYYMMDD') 
AND C.B_HERHALING=1 AND C.C_SRT_ONDERZOEK=211

Check Database>show SQL to confirm that it's correct. Some of your selections may not be shown there: this will mean that the local machine is making the selection rather than the server. It should not apply in this case.


[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
In CRXI there is the option add command - here you can write your SQL; you can base the report on the command instead of tables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top