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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Crystal run Stored Procedure then report based on procedure?

Status
Not open for further replies.

RDRaider

MIS
Nov 5, 2009
9
0
0
US
Hi,
I have a database field that stores data like A,B,F,G.
I wrote a SQL stored procedure to parse that field into its parts:
A
B
F
G

I could schedule the proc but since it is only needed for this one report, can Crystal run the proc then the report?
I thought a SQL expression would work:
Execute dbo.MyProc
then put that expression in the report header. Does not work. Is this possible?
 
You can include SQL, either as an SQL Expression or as an SQL Command. Just how you do this depending on your Crystal version, - 8, 8.5, 9, 10, 11 or whatever. Always best to give your version, methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Did you wrap in ()

(Execute dbo.MyProc)

Its a feature of Crystal ;-)

Ian
 
I am using Crystal 10. The report is using OLEDB(ADO) connection to SQL. I have tried a SQL Expression using various syntax:
Execute dbo.MyProc
(Execute dbo.MyProc)
(Execute [dbo].[MyProc])

The above results in "Incorrect syntax near Execute" or "Incorrect syntax near dbo."

I was able to add a SQL Command to run the proc but it only worked if the proc returned a result. So I added a count of records affected to the proc.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top