mangledbabyducks
Technical User
I am working in Crystal Reports 10 on an Interbase 7 database thru an EasySofy ODBC connection. This is my first attempt in trying to use an SQL command in a report. I've got all my record selection criteria into my SQL command except for one piece.
I am trying to include the following record selection from Crystal Report 10:
((Uppercase ({?ReportType}) = "C" AND {PROFILE_CUST.INTERFACEID(1)} = Uppercase ({?RequiredID}))
OR
(Uppercase ({?ReportType}) = "P" AND
ToText ({INVOICE.CLIENT_LINKNO}, 0, "") = Uppercase
({?RequiredID}))
OR
(Uppercase ({?ReportType}) = "A" AND true))
into this SQL Command:
SELECT BOOKING.TOTALFARE, INVOICE.INVOICETYPE_LINKCODE, INVOICE.ISSUEDATE, TRAVELCATEGORY.TRAVELCATEGORY, TRAVELCATEGORY.TRAVELCATEGORYNO, INVOICE.INVOICENO, INVOICE.INVOICENUMBER, PROFILE_VEND.INTERFACEID, PROFILE_CUST.NAME, BOOKING.RETURNDATE, BOOKING.DEPARTDATE, SUBMITTO.SUBMITTOCODE, TRAVELTYPE.TRAVELTYPENO, INVOICE.CLIENT_LINKNO, PROFILE_CUST.INTERFACEID, BOOKING.VENDORPAYSTATUS_LINKCODE, BRANCH.BRANCHNO, BRANCH.NAME, INVOICE.BRANCH_LINKNO, PROFILE_VEND.NAME
FROM INVOICE INVOICE
LEFT OUTER JOIN BOOKING BOOKING ON INVOICE.INVOICENO=BOOKING.INVOICE_LINKNO
LEFT OUTER JOIN BRANCH BRANCH ON INVOICE.BRANCH_LINKNO=BRANCH.BRANCHNO
LEFT OUTER JOIN PROFILE PROFILE_VEND ON BOOKING.VENDOR_LINKNO=PROFILE_VEND.PROFILENO
LEFT OUTER JOIN TRAVELTYPE TRAVELTYPE ON BOOKING.TRAVELTYPE_LINKNO=TRAVELTYPE.TRAVELTYPENO
LEFT OUTER JOIN SUBMITTO SUBMITTO ON BOOKING.SUBMITTO_LINKCODE=SUBMITTO.SUBMITTOCODE
LEFT OUTER JOIN TRAVELCATEGORY TRAVELCATEGORY ON TRAVELTYPE.TRAVELCATEGORY_LINKNO=TRAVELCATEGORY.TRAVELCATEGORYNO
LEFT OUTER JOIN PROFILE PROFILE_CUST ON PROFILE_CUST.PROFILENO=INVOICE.CLIENT_LINKNO
WHERE TRAVELCATEGORY.TRAVELCATEGORYNO IN (1,2,3)
AND ({?Branch} = 1000 OR {?Branch} = INVOICE.BRANCH_LINKNO)
AND
BOOKING.VENDORPAYSTATUS_LINKCODE<>'V' AND
(INVOICE.INVOICETYPE_LINKCODE='R' OR INVOICE.INVOICETYPE_LINKCODE='S') AND
INVOICE.ISSUEDATE BETWEEN {?Period1 Start} and {?Period1 End}
ORDER BY TRAVELCATEGORY.TRAVELCATEGORY
Thanks for all your previous answers and and the answer to this question (I hope)!!
MBD
I am trying to include the following record selection from Crystal Report 10:
((Uppercase ({?ReportType}) = "C" AND {PROFILE_CUST.INTERFACEID(1)} = Uppercase ({?RequiredID}))
OR
(Uppercase ({?ReportType}) = "P" AND
ToText ({INVOICE.CLIENT_LINKNO}, 0, "") = Uppercase
({?RequiredID}))
OR
(Uppercase ({?ReportType}) = "A" AND true))
into this SQL Command:
SELECT BOOKING.TOTALFARE, INVOICE.INVOICETYPE_LINKCODE, INVOICE.ISSUEDATE, TRAVELCATEGORY.TRAVELCATEGORY, TRAVELCATEGORY.TRAVELCATEGORYNO, INVOICE.INVOICENO, INVOICE.INVOICENUMBER, PROFILE_VEND.INTERFACEID, PROFILE_CUST.NAME, BOOKING.RETURNDATE, BOOKING.DEPARTDATE, SUBMITTO.SUBMITTOCODE, TRAVELTYPE.TRAVELTYPENO, INVOICE.CLIENT_LINKNO, PROFILE_CUST.INTERFACEID, BOOKING.VENDORPAYSTATUS_LINKCODE, BRANCH.BRANCHNO, BRANCH.NAME, INVOICE.BRANCH_LINKNO, PROFILE_VEND.NAME
FROM INVOICE INVOICE
LEFT OUTER JOIN BOOKING BOOKING ON INVOICE.INVOICENO=BOOKING.INVOICE_LINKNO
LEFT OUTER JOIN BRANCH BRANCH ON INVOICE.BRANCH_LINKNO=BRANCH.BRANCHNO
LEFT OUTER JOIN PROFILE PROFILE_VEND ON BOOKING.VENDOR_LINKNO=PROFILE_VEND.PROFILENO
LEFT OUTER JOIN TRAVELTYPE TRAVELTYPE ON BOOKING.TRAVELTYPE_LINKNO=TRAVELTYPE.TRAVELTYPENO
LEFT OUTER JOIN SUBMITTO SUBMITTO ON BOOKING.SUBMITTO_LINKCODE=SUBMITTO.SUBMITTOCODE
LEFT OUTER JOIN TRAVELCATEGORY TRAVELCATEGORY ON TRAVELTYPE.TRAVELCATEGORY_LINKNO=TRAVELCATEGORY.TRAVELCATEGORYNO
LEFT OUTER JOIN PROFILE PROFILE_CUST ON PROFILE_CUST.PROFILENO=INVOICE.CLIENT_LINKNO
WHERE TRAVELCATEGORY.TRAVELCATEGORYNO IN (1,2,3)
AND ({?Branch} = 1000 OR {?Branch} = INVOICE.BRANCH_LINKNO)
AND
BOOKING.VENDORPAYSTATUS_LINKCODE<>'V' AND
(INVOICE.INVOICETYPE_LINKCODE='R' OR INVOICE.INVOICETYPE_LINKCODE='S') AND
INVOICE.ISSUEDATE BETWEEN {?Period1 Start} and {?Period1 End}
ORDER BY TRAVELCATEGORY.TRAVELCATEGORY
Thanks for all your previous answers and and the answer to this question (I hope)!!
MBD