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!

Is it possible to send an entire SQL statement to Crystal Reports?

Status
Not open for further replies.

Frostburn

Programmer
Jul 10, 2001
8
US
Is it possible to send an entire SQL statement to Crystal Reports? I've created a great SQL statement that shows up the correct records--so I recreate it to my best ability in Crystal, and get the worst gibberish I've ever seen. Here's my statement:

SELECT DISTINCT tblSubSectionDetail.ExpTypeDesc, SSName, CurrentYearBudget
FROM tblSubSectionDetail, tblPurchaseOrder, tblSection, tblSubSection
WHERE tblSubSectionDetail.SCCode = tblSubSection.SCCode
AND tblSubSectionDetail.SSCode = tblSubSection.SSCode
AND tblSubSection.SCCode = tblSection.SCCode
AND tblSubSection.SCCode = tblPurchaseOrder.POSCCode
AND tblSection.SCName = 'Cardiology'
AND CurrentYearBudget > 0
AND tblSubSectionDetail.ExpTypeDesc = 'Salaries Expense'

Thanks for the help!
 
It doesn't appear that your SQL should be a problem to design in Crystal Reports. But...

a. you could put your SQL in a stored procedure and point the report at the stored procedure.

b. if you are using an front-end app like VB, you can replace the entire SQL statement at run-time. Brian J. Alves
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top